Move g_signals.SetBestChain(..) below SyncWithWallets #4798

pull cozz wants to merge 1 commits into bitcoin:master from cozz:cozz17 changing 1 files +6 −6
  1. cozz commented at 3:15 AM on August 31, 2014: contributor

    I believe that the setBestChain-signal should be triggered After we sync the txs. I tested in regtest, if we write the chainstate, trigger setBestChain, and then crash before syncing the txs, we dont rescan them. The same test after this patch showed "Rescanning..." in the log file.

    Looking at old code this was always the case, but has been changed due to refactorings. Also after this patch, the signal is not triggered for disconnectTip(..) anymore. I think it doesnt make much sense to trigger there, wasnt the case in old code either.

  2. sipa commented at 1:17 PM on August 31, 2014: member

    untested ACK; can you add a comment about why the order is important?

  3. Move g_signals.SetBestChain(..) below SyncWithWallets d920f7dcf8
  4. cozz force-pushed on Aug 31, 2014
  5. cozz commented at 2:22 PM on August 31, 2014: contributor

    @sipa done.

  6. BitcoinPullTester commented at 2:34 PM on August 31, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4798_d920f7dcf876f5bb5c525a55c56028fcf65cbdf1/ 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.

  7. laanwj added the label Wallet on Sep 1, 2014
  8. cdecker commented at 10:53 AM on September 1, 2014: contributor

    Looks very reasonable to me :-)

  9. TheBlueMatt commented at 2:27 AM on September 3, 2014: member

    Shouldnt you call the SetBestChain in DisconnectTip too?

  10. cozz commented at 4:14 AM on September 3, 2014: contributor

    @TheBlueMatt I cant think of a scenario where this makes sense, can you?

    In old code the signal was emitted after all the disconnects and connects. Just look at a main.cpp from the beginning of the year.

  11. sipa commented at 2:42 PM on September 3, 2014: member

    @TheBlueMatt for symmetry, I guess. But it would be extremely unlikely to matter. The locator written has exponentially-further-back block hashes, and disconnects shouldn't really be doing 1000s of blocks deep reorgs (which is the frequency at which these locators are written).

  12. laanwj commented at 9:45 AM on September 8, 2014: member

    Untested ACK

  13. jgarzik commented at 2:02 AM on September 15, 2014: contributor

    ut ACK

  14. laanwj merged this on Sep 15, 2014
  15. laanwj closed this on Sep 15, 2014

  16. laanwj referenced this in commit c362c57568 on Sep 15, 2014
  17. MarcoFalke 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-21 15:15 UTC

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