aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-tx.cpp
diff options
context:
space:
mode:
authorEric R. Schulz <ersmail@gmail.com>2014-12-22 21:04:53 -0500
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-06 17:32:31 +0100
commit06fdf326d38b02efba0ebafa4be59b4ac062c092 (patch)
treea508894ad50abd72d9ee46c072382c1802a93775 /src/bitcoin-tx.cpp
parent58fda4d6895aa1aba1d7a31500c0f823e736c3fa (diff)
downloadbitcoin-06fdf326d38b02efba0ebafa4be59b4ac062c092.tar.xz
bitcoin-tx: Fix JSON validation of prevtxs
Github-Pull: #5528 Rebased-From: 2a3d988b802dcea4453241e37168d8511078940a a089c50981e822014ffc18e8a37b3518feb52206 2c14d1532fe66a243cdbfb7de48b298213305765
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r--src/bitcoin-tx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index 7308d93661..0f16b36f14 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -368,7 +368,7 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr)
// Add previous txouts given in the RPC call:
if (!registers.count("prevtxs"))
throw runtime_error("prevtxs register variable must be set.");
- UniValue prevtxsObj = registers["privatekeys"];
+ UniValue prevtxsObj = registers["prevtxs"];
{
for (unsigned int previdx = 0; previdx < prevtxsObj.count(); previdx++) {
UniValue prevOut = prevtxsObj[previdx];
@@ -379,13 +379,13 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr)
if (!prevOut.checkObject(types))
throw runtime_error("prevtxs internal object typecheck fail");
- uint256 txid = ParseHashUV(prevOut, "txid");
+ uint256 txid = ParseHashUV(prevOut["txid"], "txid");
int nOut = atoi(prevOut["vout"].getValStr());
if (nOut < 0)
throw runtime_error("vout must be positive");
- vector<unsigned char> pkData(ParseHexUV(prevOut, "scriptPubKey"));
+ vector<unsigned char> pkData(ParseHexUV(prevOut["scriptPubKey"], "scriptPubKey"));
CScript scriptPubKey(pkData.begin(), pkData.end());
{