Wallet settings and Mempool information#551
Conversation
0e7389d to
2604815
Compare
2604815 to
746825c
Compare
| bool removed = false; | ||
| if (wallet_info.isDir()) { | ||
| QDir wallet_dir(storage_path); | ||
| removed = wallet_dir.removeRecursively(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
(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) || |
There was a problem hiding this comment.
This will not work in other languages, right?
There was a problem hiding this comment.
The bilingual error string should have the untranslated error. Ideally we have error codes, though.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Is this okay to fire when when we're locking the lock in line 681? Do we need to release the lock?
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.