Set nSequenceId when a block is fully linked #6010
pull sdaftuar wants to merge 1 commits into bitcoin:master from sdaftuar:fix-equal-work-chain-selection changing 1 files +5 −4-
sdaftuar commented at 0:26 am on April 14, 2015: memberThis fixes the assignment of nSequenceId for headers-first, which can result in blocks being downloaded out of order.
-
laanwj added the label Consensus on Apr 14, 2015
-
sipa commented at 9:14 am on April 14, 2015: memberutACK
-
laanwj added this to the milestone 0.10.0 on Apr 14, 2015
-
Set nSequenceId when a block is fully linked
Also adds a test to CheckBlockIndex
-
sdaftuar force-pushed on Apr 14, 2015
-
sdaftuar commented at 5:30 pm on April 14, 2015: memberAdded a CheckBlockIndex test and squashed.
-
in src/main.cpp: in c1ecee8f72
3268@@ -3269,6 +3269,7 @@ void static CheckBlockIndex() 3269 // HAVE_DATA is equivalent to VALID_TRANSACTIONS and equivalent to nTx > 0 (we stored the number of transactions in the block) 3270 assert(!(pindex->nStatus & BLOCK_HAVE_DATA) == (pindex->nTx == 0)); 3271 assert(((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS) == (pindex->nTx > 0)); 3272+ if (pindex->nChainTx == 0) assert(pindex->nSequenceId == 0); // nSequenceId can't be set for blocks that aren't linked
laanwj commented at 8:31 am on April 15, 2015:Won’t the new test fail on older installs, which may have already sequence numbers assigned to blocks that aren’t linked?
sipa commented at 8:39 am on April 15, 2015:nSequence id’s are memory-only; they are not stored on disk.
laanwj commented at 8:42 am on April 15, 2015:OK, goodlaanwj commented at 8:45 am on April 15, 2015: memberutACKlaanwj merged this on Apr 20, 2015laanwj closed this on Apr 20, 2015
laanwj referenced this in commit 2bc6332df8 on Apr 20, 2015laanwj referenced this in commit bac6fca3c9 on Apr 20, 2015laanwj commented at 11:54 am on April 20, 2015: memberCherry-picked to 0.10 via bac6fcagmaxwell commented at 4:51 pm on April 20, 2015: contributortested (basic operating tests) ACK.reddink referenced this in commit a77aacf0c2 on Jul 11, 2020reddink referenced this in commit f17141932b on Jul 14, 2020DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 12:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 12:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me