diff options
| author | MarcoFalke <[email protected]> | 2018-06-14 21:34:38 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2018-06-14 21:34:41 -0400 |
| commit | 2b770080a49f282e51b7e4d176b2d9fbe0f8f5db (patch) | |
| tree | ada5cf0d129ca08e499edee89f7e3d0d90d8e03a /src | |
| parent | Merge #13460: doc: Remove note to install all boost dev packages (diff) | |
| parent | Drop ParseHashUV in favor of calling ParseHashStr (diff) | |
| download | discoin-2b770080a49f282e51b7e4d176b2d9fbe0f8f5db.tar.xz discoin-2b770080a49f282e51b7e4d176b2d9fbe0f8f5db.zip | |
Merge #13422: Drop ParseHashUV in favor of calling ParseHashStr
abd2678ac1 Drop ParseHashUV in favor of calling ParseHashStr (Ben Woosley)
Pull request description:
The one existing call already validates `get_str` will pass via `checkObject`:
https://github.com/bitcoin/bitcoin/pull/13422/files#diff-8fe4d6985ee4acf8bfc1ed8db1e83cb5L586
Split from #13420
Tree-SHA512: 35dfa8c28d0c3ceac7a6de7f4eb4a44d912f4c31f5d21c9438f899566ca2b34851f1a58c3417355e55d0c33abb97385f4a47e034bfc8e3cdbbf5f73813ca0582
Diffstat (limited to 'src')
| -rw-r--r-- | src/bitcoin-tx.cpp | 2 | ||||
| -rw-r--r-- | src/core_io.h | 1 | ||||
| -rw-r--r-- | src/core_read.cpp | 8 |
3 files changed, 1 insertions, 10 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 2a594c305..e6eb723cf 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -591,7 +591,7 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr) if (!prevOut.checkObject(types)) throw std::runtime_error("prevtxs internal object typecheck fail"); - uint256 txid = ParseHashUV(prevOut["txid"], "txid"); + uint256 txid = ParseHashStr(prevOut["txid"].get_str(), "txid"); int nOut = atoi(prevOut["vout"].getValStr()); if (nOut < 0) diff --git a/src/core_io.h b/src/core_io.h index 377633ac7..1d87d21d4 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -22,7 +22,6 @@ CScript ParseScript(const std::string& s); std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false); bool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness = false, bool try_witness = true); bool DecodeHexBlk(CBlock&, const std::string& strHexBlk); -uint256 ParseHashUV(const UniValue& v, const std::string& strName); uint256 ParseHashStr(const std::string&, const std::string& strName); std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName); diff --git a/src/core_read.cpp b/src/core_read.cpp index aade7e21c..4d851610e 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -160,14 +160,6 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk) return true; } -uint256 ParseHashUV(const UniValue& v, const std::string& strName) -{ - std::string strHex; - if (v.isStr()) - strHex = v.getValStr(); - return ParseHashStr(strHex, strName); // Note: ParseHashStr("") throws a runtime_error -} - uint256 ParseHashStr(const std::string& strHex, const std::string& strName) { if (!IsHex(strHex)) // Note: IsHex("") is false |