mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Consolidate redundant implementations of ParseHashStr
This change: * adds a length check to ParseHashStr, appropriate given its use to populate a 256-bit number from a hex str. * allows the caller to handle the failure, which allows for the more appropriate JSONRPCError on failure in prioritisetransaction rpc
This commit is contained in:
@@ -25,7 +25,16 @@ std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDeco
|
||||
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);
|
||||
bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
|
||||
uint256 ParseHashStr(const std::string&, const std::string& strName);
|
||||
|
||||
/**
|
||||
* Parse a hex string into 256 bits
|
||||
* @param[in] strHex a hex-formatted, 64-character string
|
||||
* @param[out] result the result of the parasing
|
||||
* @returns true if successful, false if not
|
||||
*
|
||||
* @see ParseHashV for an RPC-oriented version of this
|
||||
*/
|
||||
bool ParseHashStr(const std::string& strHex, uint256& result);
|
||||
std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
|
||||
bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error);
|
||||
int ParseSighashString(const UniValue& sighash);
|
||||
|
||||
Reference in New Issue
Block a user