diff options
author | Matt Corallo <git@bluematt.me> | 2017-01-28 11:32:34 -0500 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2017-02-02 17:32:27 -0500 |
commit | 922bea90c274d45b13812a031242964aa15b6c1d (patch) | |
tree | 346f2e9d3d3ec0179eecfe2a3e50d7a76a1dae94 /src/rpc/rawtransaction.cpp | |
parent | 7ea0ad539ff83f09cf617a9fb7c4d774e45efdc0 (diff) |
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.
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index c10de45f8b..21396ebb09 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -835,7 +835,9 @@ UniValue signrawtransaction(const JSONRPCRequest& request) // ... and merge in other signatures: 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); |