mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
rpc: Expose ProcessNewBlockHeaders
This commit is contained in:
@@ -145,6 +145,20 @@ bool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DecodeHexBlockHeader(CBlockHeader& header, const std::string& hex_header)
|
||||
{
|
||||
if (!IsHex(hex_header)) return false;
|
||||
|
||||
const std::vector<unsigned char> header_data{ParseHex(hex_header)};
|
||||
CDataStream ser_header(header_data, SER_NETWORK, PROTOCOL_VERSION);
|
||||
try {
|
||||
ser_header >> header;
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)
|
||||
{
|
||||
if (!IsHex(strHexBlk))
|
||||
|
||||
Reference in New Issue
Block a user