Use erase instead of rewrite to remove old addr entries #994

pull sipa wants to merge 1 commits into bitcoin:master from sipa:deladdr changing 2 files +12 −20
  1. sipa commented at 6:27 pm on March 26, 2012: member
    Fixes #982.
  2. Use erase instead of rewrite to remove old addr entries 53cb1a49e7
  3. gavinandresen commented at 6:36 pm on March 26, 2012: contributor

    ACK. Tested on my Mac via:

    1. Run old code with luke’s broken testnet/ dir : result: hang
    2. Restore addr.dat with addr.dat.hang
    3. Re-run with this patch : result : happy bitcoind

    sipa: any idea why this fixes the issue, or what the issue was in the first place?

  4. sipa commented at 6:42 pm on March 26, 2012: member
    No, I don’t understand what’s going on. I made bitcoind close the entire database environnement and create a new one when doing the rewrite, and it still blocks as soon as it tries to write a single value to the file. I have no idea what it is waiting for, but bdb calls pthread_cond_wait while there is only a single thread alive, which means a guaranteed deadlock.
  5. gavinandresen referenced this in commit 84560c41c7 on Mar 26, 2012
  6. gavinandresen merged this on Mar 26, 2012
  7. gavinandresen closed this on Mar 26, 2012

  8. coblee referenced this in commit 357ed7222c on Jul 17, 2012
  9. ptschip referenced this in commit f7f227e728 on Mar 6, 2018
  10. Bushstar referenced this in commit e0a3e9d71a on Sep 10, 2019
  11. 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: 2024-11-21 12:12 UTC

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