aboutsummaryrefslogtreecommitdiff
path: root/src/core_read.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-31 10:47:52 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-12-31 10:50:06 +0100
commita5eb61d9ef18c4add55ea8a1d813c5207ecf12f2 (patch)
tree8010d86eba8b7180b05d49dfb39f47627bc7a23e /src/core_read.cpp
parent639c79a41f4627deb1ad48bbc170c5f8fe6db5d5 (diff)
parent7f718139191d67da29c5d856d29e035bbc51e659 (diff)
Merge pull request #5499
7f71813 Bugfix: prioritisetransaction: Do some basic sanity checking on txid (Luke Dashjr)
Diffstat (limited to 'src/core_read.cpp')
-rw-r--r--src/core_read.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core_read.cpp b/src/core_read.cpp
index a49705e045..7999030662 100644
--- a/src/core_read.cpp
+++ b/src/core_read.cpp
@@ -131,6 +131,11 @@ uint256 ParseHashUV(const UniValue& v, const string& strName)
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
throw runtime_error(strName+" must be hexadecimal string (not '"+strHex+"')");