Skip to content

Wallet settings and Mempool information#551

Open
johnny9 wants to merge 13 commits into
bitcoin-core:qt6from
johnny9:wallet-settings
Open

Wallet settings and Mempool information#551
johnny9 wants to merge 13 commits into
bitcoin-core:qt6from
johnny9:wallet-settings

Conversation

@johnny9
Copy link
Copy Markdown
Collaborator

@johnny9 johnny9 commented Apr 20, 2026

05-wallet-settings-opened 07-wallet-reselected-from-settings-page 08-delete-subpage-opened

@johnny9 johnny9 changed the title Wallet settings Wallet settings and mempool information Apr 20, 2026
@johnny9 johnny9 changed the title Wallet settings and mempool information Wallet settings and Mempool information Apr 20, 2026
@johnny9
Copy link
Copy Markdown
Collaborator Author

johnny9 commented Apr 21, 2026

Related to #509 and #515

@johnny9 johnny9 force-pushed the wallet-settings branch from ca68078 to fb84269 Compare May 7, 2026 09:52
bool removed = false;
if (wallet_info.isDir()) {
QDir wallet_dir(storage_path);
removed = wallet_dir.removeRecursively();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should have guards to check if the file is inside walletDir? Just so that we don't end up deleting other files if walletStoragePath() returns path outside of walletDir.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Apologies for the LLM suggested code)

const QString wallet_dir_canonical = QFileInfo(
      QString::fromStdString(m_node.walletLoader().getWalletDir())).canonicalFilePath();
const QString storage_canonical = QFileInfo(storage_path).canonicalFilePath();
const QString prefix = wallet_dir_canonical.endsWith('/')
      ? wallet_dir_canonical : wallet_dir_canonical + '/';

if (wallet_dir_canonical.isEmpty() || storage_canonical.isEmpty() ||
      storage_canonical == wallet_dir_canonical ||
      !storage_canonical.startsWith(prefix)) {
    setWalletLoadError(tr("..."));
    return false;
}


bool NeedsUnlockForPreviewBuild(const QString& error)
{
return error.contains("Transaction needs a change address", Qt::CaseInsensitive) ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will not work in other languages, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The bilingual error string should have the untranslated error. Ideally we have error codes, though.

Copy link
Copy Markdown
Collaborator Author

@johnny9 johnny9 May 11, 2026

Choose a reason for hiding this comment

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

This is fragile. I will double check if there is an alternative or if we just need to always unlock for transaction prep

interval: 3000
repeat: true
running: root.visible
onTriggered: nodeModel.refreshMempoolInfo()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we subscribe to changes? Do we not get notified if a tx was added to mempool, similar to blockTipHeightChanged?

m_wallet_load_requested = false;
setWalletLoadInProgress(false);
}
notifyOpenWalletsChanged();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this okay to fire when when we're locking the lock in line 681? Do we need to release the lock?

Copy link
Copy Markdown
Collaborator Author

@johnny9 johnny9 May 11, 2026

Choose a reason for hiding this comment

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

Ill look at changing this signal to be sure anyway. There's no reason we need to read all of the names again in this path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants