Bugfix: prioritisetransaction: Do some basic sanity checking on txid

Besides giving a nicer error, this also prevents logging arbitrary data (which could have been used to exploit log readers) into debug.log

Rebased-From: 7f71813919
Github-Pull: #5499
This commit is contained in:
Luke Dashjr
2014-12-17 09:34:09 +00:00
committed by Wladimir J. van der Laan
parent 18021d08f7
commit 1eadfd9753
3 changed files with 7 additions and 2 deletions

View File

@@ -288,8 +288,7 @@ Value prioritisetransaction(const Array& params, bool fHelp)
+ HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000")
);
uint256 hash;
hash.SetHex(params[0].get_str());
uint256 hash = ParseHashStr(params[0].get_str(), "txid");
CAmount nAmount = params[2].get_int64();