Merge pull request #500 from isocolsky/improve-error-log

Improve logs on BAD_SIGNATURE error
This commit is contained in:
Matias Alejo Garcia 2016-04-27 14:14:12 -03:00
commit c1347871f0
1 changed files with 10 additions and 1 deletions

View File

@ -2179,8 +2179,17 @@ WalletService.prototype.signTx = function(opts, cb) {
var copayer = wallet.getCopayer(self.copayerId);
if (!txp.sign(self.copayerId, opts.signatures, copayer.xPubKey))
if (!txp.sign(self.copayerId, opts.signatures, copayer.xPubKey)) {
log.warn('Error signing transaction (BAD_SIGNATURES)');
log.warn('Wallet id:', self.walletId);
log.warn('Copayer id:', self.copayerId);
log.warn('Client version:', self.clientVersion);
log.warn('Arguments:', JSON.stringify(opts));
log.warn('Transaction proposal:', JSON.stringify(txp));
var raw = txp.getBitcoreTx().uncheckedSerialize();
log.warn('Raw tx:', raw);
return cb(Errors.BAD_SIGNATURES);
}
self.storage.storeTx(self.walletId, txp, function(err) {
if (err) return cb(err);