Skip to content

Commit dd0df81

Browse files
committed
Document ConnectBlock connectTrace postconditions
1 parent 2d6e561 commit dd0df81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/validation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,10 @@ struct ConnectTrace {
21642164
/**
21652165
* Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock
21662166
* corresponding to pindexNew, to bypass loading it again from disk.
2167+
*
2168+
* The block is always added to connectTrace (either after loading from disk or by copying
2169+
* pblock) - if that is not intended, care must be taken to remove the last entry in
2170+
* blocksConnected in case of failure.
21672171
*/
21682172
bool static ConnectTip(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, ConnectTrace& connectTrace)
21692173
{

0 commit comments

Comments
 (0)