[Wallet] Simplify SetMerkleBranch(..) to SetHashBlock(..) #4938

pull cozz wants to merge 2 commits into bitcoin:master from cozz:cozz8 changing 4 files +29 −115
  1. cozz commented at 1:45 AM on September 18, 2014: contributor

    Builds on top of #4925

    We do not need the return value of SetMerkleBranch(..) and we only call it with NON-NULL pointer. The only thing thats left what we need is to set hashBlock.

  2. Get rid of stored merkle branches.
    Do not store merkle branches inside the wallet. This means removing the check
    that someone might have inserted an unconfirmed transaction in your wallet and
    making it look like a confirmed one.
    
    This means we don't need to keep the merkle branch in wallets (which takes up to
    half a kilobyte per transactions), we don't need to validate it (which requires
    a dozen sha256 operation per wallet transaction), remove the need to keep the
    merkle tree in blocks (the case where it's needed is done separately in
    CPartialMerkleTree), and simplifies the merkle root computation.
    059b549dd1
  3. laanwj added the label Wallet on Sep 18, 2014
  4. sipa commented at 4:43 PM on September 19, 2014: member

    This also means not storing nIndex anymore. Do we want that?

  5. cozz commented at 5:02 PM on September 19, 2014: contributor

    I didnt realize nIndex is a member-variable. But we should pass the index to the function, instead of looping again and searching for it. I'll change it.

  6. sipa commented at 5:19 PM on September 19, 2014: member

    We currently don't need nIndex either, but it's information I'd like to keep around as it allows us to reconstruct the merkle path as long as the full blocks are available.

  7. [Wallet] Simplify SetMerkleBranch(..) to SetHashBlock(..) 4333cc1c86
  8. cozz force-pushed on Sep 19, 2014
  9. cozz commented at 6:34 PM on September 19, 2014: contributor

    update: I added the code-block with nIndex back in now. I would prefer passing nIndex as parameter, but that can be done another time.

  10. BitcoinPullTester commented at 6:52 PM on September 19, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4938_4333cc1c86c6164fd78621fb0d23e7e0eaabff79/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  11. cozz commented at 3:49 AM on September 23, 2014: contributor

    Closing. I didnt see #4787 already exists.

  12. cozz closed this on Sep 23, 2014

  13. 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-19 03:15 UTC

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