Skip to content

Commit 37aefff

Browse files
committed
Fix init segfault where InitLoadWallet() calls ATMP before genesis
1 parent 49c5910 commit 37aefff

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/init.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
14881488
uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait);
14891489
}
14901490

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();
1496+
#endif
1497+
14911498
// ********************************************************* Step 11: start node
14921499

14931500
//// debug print

src/wallet/wallet.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,8 +3467,6 @@ bool CWallet::InitLoadWallet()
34673467
LogPrintf("mapWallet.size() = %u\n", walletInstance->mapWallet.size());
34683468
LogPrintf("mapAddressBook.size() = %u\n", walletInstance->mapAddressBook.size());
34693469
}
3470-
// Add wallet transactions that aren't already in a block to mapTransactions
3471-
walletInstance->ReacceptWalletTransactions();
34723470

34733471
pwalletMain = walletInstance;
34743472

0 commit comments

Comments
 (0)