commit
a266ec94e2
|
@ -158,8 +158,7 @@ TxProposal.prototype._addSignaturesToBitcoreTx = function(t, signatures, xpub) {
|
||||||
if (signatures.length != this.inputs.length)
|
if (signatures.length != this.inputs.length)
|
||||||
throw new Error('Number of signatures does not match number of inputs');
|
throw new Error('Number of signatures does not match number of inputs');
|
||||||
|
|
||||||
var oks = 0,
|
var i = 0,
|
||||||
i = 0,
|
|
||||||
x = new Bitcore.HDPublicKey(xpub);
|
x = new Bitcore.HDPublicKey(xpub);
|
||||||
|
|
||||||
_.each(signatures, function(signatureHex) {
|
_.each(signatures, function(signatureHex) {
|
||||||
|
@ -173,14 +172,12 @@ TxProposal.prototype._addSignaturesToBitcoreTx = function(t, signatures, xpub) {
|
||||||
sigtype: Bitcore.crypto.Signature.SIGHASH_ALL,
|
sigtype: Bitcore.crypto.Signature.SIGHASH_ALL,
|
||||||
publicKey: pub,
|
publicKey: pub,
|
||||||
};
|
};
|
||||||
|
t.inputs[i].addSignature(t,s);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
t.applySignature(s);
|
|
||||||
oks++;
|
|
||||||
} catch (e) {};
|
} catch (e) {};
|
||||||
});
|
});
|
||||||
|
|
||||||
if (oks != t.inputs.length)
|
if (i != t.inputs.length)
|
||||||
throw new Error('Wrong signatures');
|
throw new Error('Wrong signatures');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue