aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2023-01-04 18:01:52 +0000
committerglozow <gloriajzhao@gmail.com>2023-01-04 18:07:31 +0000
commit196a43eddb96ca087ad81c5beb86ffe67ab7bcf3 (patch)
tree101ea8315ef27e2c28ae0c632c11a3878558a6c6 /src/consensus
parent65ecf24b5c42d3f5320c58c56387fef22eecdecb (diff)
parentf537127271b1f22ee4651915b7b9266e0df72841 (diff)
downloadbitcoin-196a43eddb96ca087ad81c5beb86ffe67ab7bcf3.tar.xz
Merge bitcoin/bitcoin#26603: doc: CalculateSequenceLocks: prevHeights entries are set to 0, not removed
f537127271b1f22ee4651915b7b9266e0df72841 doc: fix: prevHeights entries are set to 0, not removed (stickies-v) Pull request description: In [`CalculateSequenceLocks`](https://github.com/bitcoin/bitcoin/blob/a035b6a0c418d0b720707df69559028bd662fa70/src/consensus/tx_verify.h#L69) no items are removed from `prevHeights`, they are just set to 0: https://github.com/bitcoin/bitcoin/blob/a035b6a0c418d0b720707df69559028bd662fa70/src/consensus/tx_verify.cpp#L69-L73 This PR updates the docs to reflect the actual implementation. Seems to have been wrongly documented since introduction in #7184 already ([implementation](https://github.com/bitcoin/bitcoin/pull/7184/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R742-R749) and [documentation](https://github.com/bitcoin/bitcoin/pull/7184/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R712-R713)) ACKs for top commit: hebasto: ACK f537127271b1f22ee4651915b7b9266e0df72841 Tree-SHA512: 3661501660f6832b2116fd83466ffe95a60b341c14cb09a37489e2a587bea3290b0528690120a0f644c3eea02177aa1fb8968258482fa43b0303e016abb17418
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/tx_verify.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/consensus/tx_verify.h b/src/consensus/tx_verify.h
index 1209c0faa5..d2cf792cf3 100644
--- a/src/consensus/tx_verify.h
+++ b/src/consensus/tx_verify.h
@@ -63,8 +63,8 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
/**
* Calculates the block height and previous block's median time past at
* which the transaction will be considered final in the context of BIP 68.
- * Also removes from the vector of input heights any entries which did not
- * correspond to sequence locked inputs as they do not affect the calculation.
+ * For each input that is not sequence locked, the corresponding entries in
+ * prevHeights are set to 0 as they do not affect the calculation.
*/
std::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector<int>& prevHeights, const CBlockIndex& block);