Merge pull request #2998 from matiu/feat/nosign-backup

export backup without signing capabilities
This commit is contained in:
Gustavo Maximiliano Cortez 2015-07-16 12:01:35 -03:00
commit d446c9facf
8 changed files with 96 additions and 11 deletions

View file

@ -53,13 +53,14 @@ angular.module('copayApp.services')
return cb();
};
root.walletExport = function(password) {
root.walletExport = function(password, opts) {
if (!password) {
return null;
}
var fc = profileService.focusedClient;
try {
var b = fc.export({});
opts = opts || {};
var b = fc.export(opts);
var e = sjcl.encrypt(password, b, {
iter: 10000
});
@ -70,12 +71,13 @@ angular.module('copayApp.services')
};
};
root.walletDownload = function(password, cb) {
root.walletDownload = function(password, opts, cb) {
var fc = profileService.focusedClient;
var ew = root.walletExport(password);
var ew = root.walletExport(password, opts);
if (!ew) return cb('Could not create backup');
var walletName = (fc.alias || '') + (fc.alias ? '-' : '') + fc.credentials.walletName;
if (opts.noSign) walletName = walletName + '-noSign'
var filename = walletName + '-Copaybackup.aes.json';
_download(ew, filename, cb)
};

View file

@ -7,6 +7,7 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
var fc = profileService.focusedClient;
var status = txp.status;
var type;
var INMEDIATE_SECS = 10;
if (status == 'broadcasted') {
type = 'broadcasted';
@ -17,10 +18,15 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
copayerId: fc.credentials.copayerId
});
if (!action || (action.type == 'accept' && n == 1)) {
if (!action) {
type = 'created';
} else if (action.type == 'accept') {
type = 'accepted';
// created and accepted at the same time?
if ( n == 1 && action.createdOn - txp.createdOn < INMEDIATE_SECS ) {
type = 'created';
} else {
type = 'accepted';
}
} else if (action.type == 'reject') {
type = 'rejected';
} else {