| 233 | } |
| 234 | |
| 235 | bool DecodeHexBlockHeader(CBlockHeader& header, const std::string& hex_header) |
| 236 | { |
| 237 | if (!IsHex(hex_header)) return false; |
| 238 | |
| 239 | const std::vector<unsigned char> header_data{ParseHex(hex_header)}; |
| 240 | try { |
| 241 | SpanReader{header_data} >> header; |
| 242 | } catch (const std::exception&) { |
| 243 | return false; |
| 244 | } |
| 245 | return true; |
| 246 | } |
| 247 | |
| 248 | bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk) |
| 249 | { |