MCPcopy Create free account
hub / github.com/ElementsProject/elements / EXCLUSIVE_LOCKS_REQUIRED

Function EXCLUSIVE_LOCKS_REQUIRED

src/rpc/blockchain.cpp:1041–1057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1039}
1040
1041static CBlock GetBlockChecked(const CBlockIndex* pblockindex) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
1042{
1043 AssertLockHeld(::cs_main);
1044 CBlock block;
1045 if (IsBlockPruned(pblockindex)) {
1046 throw JSONRPCError(RPC_MISC_ERROR, "Block not available (pruned data)");
1047 }
1048
1049 if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus())) {
1050 // Block not found on disk. This could be because we have the block
1051 // header in our index but not yet have the block or did not accept the
1052 // block.
1053 throw JSONRPCError(RPC_MISC_ERROR, "Block not found on disk");
1054 }
1055
1056 return block;
1057}
1058
1059static CBlockUndo GetUndoChecked(const CBlockIndex* pblockindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1060{

Callers 4

waitfornewblockFunction · 0.70
waitforblockFunction · 0.70
waitforblockheightFunction · 0.70
blockchain.cppFile · 0.70

Calls 5

IsBlockPrunedFunction · 0.85
JSONRPCErrorFunction · 0.85
ReadBlockFromDiskFunction · 0.85
UndoReadFromDiskFunction · 0.85
ParamsClass · 0.50

Tested by

no test coverage detected