aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-11-29 21:25:39 -0800
committerMatt Corallo <git@bluematt.me>2016-12-04 00:18:44 -0800
commitdd0df81ebdbf705f7ad386c7229bf1bbc3125f62 (patch)
tree5ad956d19aa507f94eb195c438be06ea7c5b18a9
parent2d6e5619afa2d43a37a0a38daf33f58965ddfa80 (diff)
downloadbitcoin-dd0df81ebdbf705f7ad386c7229bf1bbc3125f62.tar.xz
Document ConnectBlock connectTrace postconditions
-rw-r--r--src/validation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 0983c1f762..3bcbf33d66 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2164,6 +2164,10 @@ struct ConnectTrace {
/**
* Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock
* corresponding to pindexNew, to bypass loading it again from disk.
+ *
+ * The block is always added to connectTrace (either after loading from disk or by copying
+ * pblock) - if that is not intended, care must be taken to remove the last entry in
+ * blocksConnected in case of failure.
*/
bool static ConnectTip(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, ConnectTrace& connectTrace)
{