Skip to content

Commit 0e59bad

Browse files
TheBlueMattfurszy
authored andcommitted
Document ConnectBlock connectTrace postconditions
1 parent 908ffd9 commit 0e59bad

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
@@ -1934,6 +1934,10 @@ struct ConnectTrace {
19341934
/**
19351935
* Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock
19361936
* corresponding to pindexNew, to bypass loading it again from disk.
1937+
*
1938+
* The block is always added to connectTrace (either after loading from disk or by copying
1939+
* pblock) - if that is not intended, care must be taken to remove the last entry in
1940+
* blocksConnected in case of failure.
19371941
*/
19381942
bool static ConnectTip(CValidationState& state, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, bool fAlreadyChecked, ConnectTrace& connectTrace)
19391943
{

0 commit comments

Comments
 (0)