Remove duplicate GetHash() in ConnectBlock #1554

pull jgarzik wants to merge 2 commits into bitcoin:master from jgarzik:dup-gethash changing 2 files +17 −19
  1. jgarzik commented at 4:11 AM on July 4, 2012: contributor

    Pull request #1486 contains a bunch of BlueMatt commits in a stack. Pulled out this one out of the stack, and rebased it on top of current HEAD.

  2. Remove duplicate GetHash() in ConnectBlock 96929a5515
  3. CTxMemPool: eliminate redundant lock, GetHash() call
    ::addUnchecked()'s only caller already takes the necessary lock,
    and has already calculated the TX's hash.
    f77654a0e9
  4. jgarzik commented at 5:18 AM on July 4, 2012: contributor

    Added new commit, to eliminate a dup GetHash in mempool code

  5. in src/main.cpp:None in f77654a0e9
    1337 | @@ -1351,6 +1338,17 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
    1338 |      unsigned int nSigOps = 0;
    1339 |      BOOST_FOREACH(CTransaction& tx, vtx)
    1340 |      {
    


    sipa commented at 9:01 AM on July 4, 2012:

    This BIP30 test has to happen before any transactions are connected. It is not allowed to create a new transaction whose last output is spent within the same block.


    TheBlueMatt commented at 11:57 AM on July 4, 2012:

    No changes to txdb are written in the loop, only to mapQueuedChanges.


    sipa commented at 12:13 PM on July 4, 2012:

    Right, my mistake. I changed this in my ultraprune branch, however.

  6. TheBlueMatt commented at 10:08 PM on July 4, 2012: member

    While you are taking commits out of #1486 that apply cleanly to master, you can try: 3298e89b38a90c9bcdec32ac939c0e6ec5fcea14, 9ad2f5788e80bebad957e89bd7686706ba28dd53 and if you want to be a bit more adventurous, 80e3ac4168da89cf4a78d3974e00e314e9cb0883.

  7. gavinandresen commented at 4:38 PM on July 5, 2012: contributor

    ACK

  8. jgarzik referenced this in commit b47d2bc164 on Jul 5, 2012
  9. jgarzik merged this on Jul 5, 2012
  10. jgarzik closed this on Jul 5, 2012

  11. nifgraup referenced this in commit 5a287fb6ce on Mar 30, 2014
  12. DrahtBot 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: 2026-04-20 00:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me