send, coins: don't allow tx construction during blockchain sync

This commit is contained in:
tobtoht 2024-05-03 12:15:51 +02:00
parent 8b0013496c
commit e2eb8e4ed3
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
2 changed files with 13 additions and 1 deletions

View file

@ -212,6 +212,18 @@ void CoinsWidget::viewOutput() {
} }
void CoinsWidget::onSweepOutputs() { void CoinsWidget::onSweepOutputs() {
if (!m_wallet->isConnected()) {
Utils::showError(this, "Unable to create transaction", "Wallet is not connected to a node.",
{"Wait for the wallet to automatically connect to a node.", "Go to File -> Settings -> Network -> Node to manually connect to a node."},
"nodes");
return;
}
if (!m_wallet->isSynchronized()) {
Utils::showError(this, "Unable to create transaction", "Wallet is not synchronized", {"Wait for wallet synchronization to complete"}, "synchronization");
return;
}
QVector<CoinsInfo*> selectedCoins = this->currentEntries(); QVector<CoinsInfo*> selectedCoins = this->currentEntries();
QVector<QString> keyImages; QVector<QString> keyImages;

View file

@ -487,7 +487,7 @@ void Wallet::onHeightsRefreshed(bool success, quint64 daemonHeight, quint64 targ
this->syncStatusUpdated(walletHeight, daemonHeight); this->syncStatusUpdated(walletHeight, daemonHeight);
} }
if (walletHeight < (daemonHeight - 1)) { if (walletHeight < (targetHeight - 1)) {
setConnectionStatus(ConnectionStatus_Synchronizing); setConnectionStatus(ConnectionStatus_Synchronizing);
} else { } else {
setConnectionStatus(ConnectionStatus_Synchronized); setConnectionStatus(ConnectionStatus_Synchronized);