fix
This commit is contained in:
parent
d669f86c7d
commit
0d81cf8e9c
2 changed files with 17 additions and 3 deletions
|
|
@ -53,6 +53,14 @@ angular.module('copayApp.services')
|
|||
return cb();
|
||||
};
|
||||
|
||||
root.addMetadata = function(b, opts) {
|
||||
|
||||
b = JSON.parse(b);
|
||||
if (opts.historyCache) b.historyCache = opts.historyCache;
|
||||
if (opts.addressBook) b.addressBook = opts.addressBook;
|
||||
return JSON.stringify(b);
|
||||
}
|
||||
|
||||
root.walletExport = function(password, opts) {
|
||||
if (!password) {
|
||||
return null;
|
||||
|
|
@ -61,6 +69,8 @@ angular.module('copayApp.services')
|
|||
try {
|
||||
opts = opts || {};
|
||||
var b = fc.export(opts);
|
||||
if (opts.historyCache || opts.addressBook) b = root.addMetadata(b, opts);
|
||||
|
||||
var e = sjcl.encrypt(password, b, {
|
||||
iter: 10000
|
||||
});
|
||||
|
|
@ -82,4 +92,4 @@ angular.module('copayApp.services')
|
|||
_download(ew, filename, cb)
|
||||
};
|
||||
return root;
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue