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
  1. sdaftuar commented at 0:26 am on April 14, 2015: member
    This fixes the assignment of nSequenceId for headers-first, which can result in blocks being downloaded out of order.
  2. laanwj added the label Consensus on Apr 14, 2015
  3. sipa commented at 9:14 am on April 14, 2015: member
    utACK
  4. laanwj added this to the milestone 0.10.0 on Apr 14, 2015
  5. Set nSequenceId when a block is fully linked
    Also adds a test to CheckBlockIndex
    c1ecee8f72
  6. sdaftuar force-pushed on Apr 14, 2015
  7. sdaftuar commented at 5:30 pm on April 14, 2015: member
    Added a CheckBlockIndex test and squashed.
  8. 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, good
  9. laanwj commented at 8:45 am on April 15, 2015: member
    utACK
  10. laanwj merged this on Apr 20, 2015
  11. laanwj closed this on Apr 20, 2015

  12. laanwj referenced this in commit 2bc6332df8 on Apr 20, 2015
  13. laanwj referenced this in commit bac6fca3c9 on Apr 20, 2015
  14. laanwj commented at 11:54 am on April 20, 2015: member
    Cherry-picked to 0.10 via bac6fca
  15. gmaxwell commented at 4:51 pm on April 20, 2015: contributor
    tested (basic operating tests) ACK.
  16. reddink referenced this in commit a77aacf0c2 on Jul 11, 2020
  17. reddink referenced this in commit f17141932b on Jul 14, 2020
  18. DrahtBot locked this on Sep 8, 2021


sdaftuar sipa laanwj gmaxwell

Labels
Consensus

Milestone
0.10.0


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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me