From 92ec877c84d60e8468fdb59b0e09262678aee4cd Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Wed, 21 Nov 2018 18:24:28 -0800 Subject: [PATCH] fix bug where default pay from address was wrong --- src/mainwindow.h | 3 ++- src/rpc.cpp | 4 ++++ src/sendtab.cpp | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.h b/src/mainwindow.h index 4d742b7..265b62c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -39,6 +39,8 @@ public: void updateLabelsAutoComplete(); + void setDefaultPayFrom(); + Ui::MainWindow* ui; QLabel* statusLabel; @@ -61,7 +63,6 @@ private: void setupStatusBar(); void removeExtraAddresses(); - void setDefaultPayFrom(); Tx createTxFromSendPage(); bool confirmTx(Tx tx); diff --git a/src/rpc.cpp b/src/rpc.cpp index 514bd5a..2cd21f3 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -646,6 +646,10 @@ void RPC::updateUI(bool anyUnconfirmed) { ++i; } + + if (lastFromAddr.isEmpty()) { + main->setDefaultPayFrom(); + } }; // Function to process reply of the listunspent and z_listunspent API calls, used below. diff --git a/src/sendtab.cpp b/src/sendtab.cpp index ceb44dd..d8e111a 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -17,8 +17,6 @@ void MainWindow::setupSendTab() { amtValidator->setNotation(QDoubleValidator::StandardNotation); ui->Amount1->setValidator(amtValidator); - setDefaultPayFrom(); - // Send button QObject::connect(ui->sendTransactionButton, &QPushButton::clicked, this, &MainWindow::sendButton);