From 37aefff5fcf7169a1b07ff8939850f630640f7e7 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 15 Oct 2016 13:19:16 -0400 Subject: [PATCH] Fix init segfault where InitLoadWallet() calls ATMP before genesis --- src/init.cpp | 7 +++++++ src/wallet/wallet.cpp | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index eefef7ba0..057d8eefe 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1488,6 +1488,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait); } +#ifdef ENABLE_WALLET + // Add wallet transactions that aren't already in a block to mempool + // Do this here as mempool requires genesis block to be loaded + if (pwalletMain) + pwalletMain->ReacceptWalletTransactions(); +#endif + // ********************************************************* Step 11: start node //// debug print diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a1f69dd94..6f86f3360 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3467,8 +3467,6 @@ bool CWallet::InitLoadWallet() LogPrintf("mapWallet.size() = %u\n", walletInstance->mapWallet.size()); LogPrintf("mapAddressBook.size() = %u\n", walletInstance->mapAddressBook.size()); } - // Add wallet transactions that aren't already in a block to mapTransactions - walletInstance->ReacceptWalletTransactions(); pwalletMain = walletInstance;