Fix init segfault where InitLoadWallet() calls ATMP before genesis #8928

pull TheBlueMatt wants to merge 1 commits into bitcoin:master from TheBlueMatt:2016-10-fix-segfault changing 2 files +7 −2
  1. TheBlueMatt commented at 5:21 pm on October 15, 2016: member
    I honestly have no idea how the wallet.py tests are passing for anyone, but they reliably cause segfault here for me.
  2. Fix init segfault where InitLoadWallet() calls ATMP before genesis 37aefff5fc
  3. MarcoFalke commented at 10:18 am on October 16, 2016: member

    utACK 37aefff5fcf7169a1b07ff8939850f630640f7e7

    Edit: Indeed interesting that this does not fail on trusty.

    Tested ACK 37aefff, otherwise.

  4. MarcoFalke added the label Wallet on Oct 16, 2016
  5. in src/init.cpp: in 37aefff5fc
    1487@@ -1488,6 +1488,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
    1488         uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait);
    1489     }
    1490 
    1491+#ifdef ENABLE_WALLET
    1492+    // Add wallet transactions that aren't already in a block to mempool
    1493+    // Do this here as mempool requires genesis block to be loaded
    1494+    if (pwalletMain)
    1495+        pwalletMain->ReacceptWalletTransactions();
    


    jonasschnelli commented at 6:49 am on October 17, 2016:
    Meh on extending the usage of pwalletMain in init.cpp. If this is really necessary, can’t we pack it “behind” CWallet?

    jonasschnelli commented at 6:51 am on October 17, 2016:
    Or what about moving down the if (!CWallet::InitLoadWallet()) from L1426 to the part?

    laanwj commented at 4:12 pm on October 19, 2016:
    @jonasschnelli we can do this later
  6. in src/init.cpp: in 37aefff5fc
    1487@@ -1488,6 +1488,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
    1488         uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait);
    1489     }
    1490 
    1491+#ifdef ENABLE_WALLET
    


    laanwj commented at 9:21 pm on October 18, 2016:
    It’s unfortunate that this has to introduce a new #ifdef ENABLE_WALLET here, and ref to pWalletMain. We’re trying to get rid of them to remove the circular dependency between_wallet and _server libs (#7965), and in the interest of multi-wallet support.

    MarcoFalke commented at 9:08 am on October 19, 2016:

    It could be combined with the guard a few lines below, but this won’t solve the larger problem.

    I think for a bugfix this is fine.


    laanwj commented at 4:10 pm on October 19, 2016:
    Yes I agree, let’s merge this as it is a necessary bugfix, this can be improved later.
  7. laanwj commented at 9:23 pm on October 18, 2016: member
    utACK otherwise
  8. jonasschnelli changes_requested
  9. laanwj merged this on Oct 19, 2016
  10. laanwj closed this on Oct 19, 2016

  11. laanwj referenced this in commit c587577356 on Oct 19, 2016
  12. codablock referenced this in commit f21b2ecc84 on Sep 19, 2017
  13. codablock referenced this in commit fdd0638161 on Jan 9, 2018
  14. andvgal referenced this in commit 8b885462a1 on Jan 6, 2019
  15. 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: 2024-11-27 06:12 UTC

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