MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetUndoChecked

Function GetUndoChecked

src/rpc/blockchain.cpp:728–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728static CBlockUndo GetUndoChecked(BlockManager& blockman, const CBlockIndex& blockindex)
729{
730 CBlockUndo blockUndo;
731
732 // The Genesis block does not have undo data
733 if (blockindex.nHeight == 0) return blockUndo;
734
735 {
736 LOCK(cs_main);
737 CheckBlockDataAvailability(blockman, blockindex, /*check_for_undo=*/true);
738 }
739
740 if (!blockman.ReadBlockUndo(blockUndo, blockindex)) {
741 throw JSONRPCError(RPC_MISC_ERROR, "Can't read undo data from disk");
742 }
743
744 return blockUndo;
745}
746
747static std::vector<RPCResult> GetBlockFields(RPCResult tx_result, std::optional<std::string> elision_msg = std::nullopt)
748{

Callers 3

getblockstatsFunction · 0.85
CheckBlockFilterMatchesFunction · 0.85
getdescriptoractivityFunction · 0.85

Calls 3

JSONRPCErrorFunction · 0.85
ReadBlockUndoMethod · 0.80

Tested by

no test coverage detected