aboutsummaryrefslogtreecommitdiff
path: root/src/rpcrawtransaction.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-02-06 10:02:28 -0800
committerGavin Andresen <[email protected]>2013-02-06 10:02:28 -0800
commit817c44a00dbc9365432bedfeb7cf38dfaa112d5e (patch)
tree2c126868a758dc8dd175b82006b613f2d5758d6f /src/rpcrawtransaction.cpp
parentMerge pull request #2259 from Criptomonedas/dontresend (diff)
parentSignrawtransaction shouldn't require redeemScript for non-p2sh txins. (diff)
downloaddiscoin-817c44a00dbc9365432bedfeb7cf38dfaa112d5e.tar.xz
discoin-817c44a00dbc9365432bedfeb7cf38dfaa112d5e.zip
Merge pull request #2264 from gmaxwell/signrawtransaction_for_regular_missing_txins
Signrawtransaction shouldn't require redeemScript for non-p2sh txins.
Diffstat (limited to 'src/rpcrawtransaction.cpp')
-rw-r--r--src/rpcrawtransaction.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index 5224051ac..bbaf40c73 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -421,7 +421,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
Object prevOut = p.get_obj();
- RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type));
uint256 txid = ParseHashO(prevOut, "txid");
@@ -450,12 +450,16 @@ Value signrawtransaction(const Array& params, bool fHelp)
// if redeemScript given and not using the local wallet (private keys
// given), add redeemScript to the tempKeystore so it can be signed:
- Value v = find_value(prevOut, "redeemScript");
- if (fGivenKeys && scriptPubKey.IsPayToScriptHash() && !(v == Value::null))
+ if (fGivenKeys && scriptPubKey.IsPayToScriptHash())
{
- vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
- CScript redeemScript(rsData.begin(), rsData.end());
- tempKeystore.AddCScript(redeemScript);
+ RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ Value v = find_value(prevOut, "redeemScript");
+ if (!(v == Value::null))
+ {
+ vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
+ CScript redeemScript(rsData.begin(), rsData.end());
+ tempKeystore.AddCScript(redeemScript);
+ }
}
}
}