mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #3287 from bitpay/revert-3274-fix/paperWallet-getTx
Revert "improve transaction method"
This commit is contained in:
commit
8ff87520fe
|
@ -51,17 +51,20 @@ angular.module('copayApp.controllers').controller('paperWalletController',
|
|||
fc.decryptBIP38PrivateKey(privateKey, passphrase, null, function(err, privateKey) {
|
||||
if (err) return cb(err);
|
||||
|
||||
self.getRawTxFromPrivateKey(privateKey, function(err) {
|
||||
fc.getBalanceFromPrivateKey(privateKey, function(err, utxos) {
|
||||
if (err) return cb(err);
|
||||
});
|
||||
});
|
||||
} else
|
||||
self.getRawTxFromPrivateKey(privateKey, function(err) {
|
||||
if (err) return cb(err);
|
||||
});
|
||||
};
|
||||
|
||||
self.getRawTxFromPrivateKey = function(privateKey, cb) {
|
||||
addressService.getAddress(fc.credentials.walletId, true, function(err, destinationAddress) {
|
||||
if (err) return cb(err);
|
||||
|
||||
fc.buildTxFromPrivateKey(privateKey, destinationAddress, null, function(err, tx) {
|
||||
if (err) return cb(err);
|
||||
return cb(null, tx.serialize(), utxos);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
fc.getBalanceFromPrivateKey(privateKey, function(err, utxos) {
|
||||
if (err) return cb(err)
|
||||
|
||||
|
@ -75,6 +78,7 @@ angular.module('copayApp.controllers').controller('paperWalletController',
|
|||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
self.transaction = function() {
|
||||
self.error = null;
|
||||
|
|
Loading…
Reference in New Issue