MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / DecodeHexBlk

Function DecodeHexBlk

src/core_read.cpp:148–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk, bool fLegacyFormat)
149{
150 if (!IsHex(strHexBlk))
151 return false;
152
153 std::vector<unsigned char> blockData(ParseHex(strHexBlk));
154 int ser_flags = fLegacyFormat ? SERIALIZE_BLOCK_LEGACY : 0;
155 CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION | ser_flags);
156 try {
157 ssBlock >> block;
158 }
159 catch (const std::exception&) {
160 return false;
161 }
162
163 return true;
164}
165
166bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error)
167{

Callers 2

getblocktemplateFunction · 0.85
submitblockFunction · 0.85

Calls 2

IsHexFunction · 0.85
ParseHexFunction · 0.85

Tested by

no test coverage detected