Browse Source

Better handle invalid parameters to signrawtransaction

This silently skips trying to merge signatures from inputs which
do not exist from transactions provided to signrawtransaction,
instead of hitting an assert.
0.14
Matt Corallo 8 years ago
parent
commit
922bea90c2
  1. 4
      src/rpc/rawtransaction.cpp

4
src/rpc/rawtransaction.cpp

@ -835,7 +835,9 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
// ... and merge in other signatures: // ... and merge in other signatures:
BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { BOOST_FOREACH(const CMutableTransaction& txv, txVariants) {
sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(txv, i)); if (txv.vin.size() > i) {
sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(txv, i));
}
} }
UpdateTransaction(mergedTx, i, sigdata); UpdateTransaction(mergedTx, i, sigdata);

Loading…
Cancel
Save