Skip to content

Conversation

@icota
Copy link
Contributor

@icota icota commented Sep 24, 2019

Avoid early call to loadwallet crashing bitcoin-qt. Meant to fix #16937.

Avoids early call to loadwallet crashing bitcoin-qt (bitcoin#16937)
{
m_handler_load_wallet = m_node.handleLoadWallet([this](std::unique_ptr<interfaces::Wallet> wallet) {
getOrCreateWallet(std::move(wallet));
if (wallet) getOrCreateWallet(std::move(wallet));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case wallet is null?

Copy link
Contributor

@cvengler cvengler Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See line 95 in qt/walletcontroller.cpp
There it checks if the wallet is empty even though it isn't null (I think).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promag In case you call loadwallet very early in bitcoin-qt init. @fanquake has written a python script in #16937 that triggers it consistently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Care to elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot to update this, see #16963.

Note that conceptually you are being notified about a new wallet, it should exist! Also this change hides a more severe problem which is explained in my PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, closing this now in favour of #16963.

@DrahtBot DrahtBot added the GUI label Sep 24, 2019
@icota icota closed this Sep 25, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bitcoin-qt crash after early call to loadwallet

5 participants