-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Fix init segfault where InitLoadWallet() calls ATMP before genesis #8928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1488,6 +1488,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) | |||
uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait); | |||
} | |||
|
|||
#ifdef ENABLE_WALLET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree, let's merge this as it is a necessary bugfix, this can be improved later.
utACK otherwise |
// 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh on extending the usage of pwalletMain
in init.cpp
. If this is really necessary, can't we pack it "behind" CWallet
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or what about moving down the if (!CWallet::InitLoadWallet())
from L1426 to the part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonasschnelli we can do this later
…re genesis 37aefff Fix init segfault where InitLoadWallet() calls ATMP before genesis (Matt Corallo)
…MP before genesis 37aefff Fix init segfault where InitLoadWallet() calls ATMP before genesis (Matt Corallo)
…MP before genesis 37aefff Fix init segfault where InitLoadWallet() calls ATMP before genesis (Matt Corallo)
I honestly have no idea how the wallet.py tests are passing for anyone, but they reliably cause segfault here for me.