diff --git a/src/mainwindow.h b/src/mainwindow.h index c789081..409df82 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -92,7 +92,7 @@ private: void restoreSavedStates(); - QString addressFromAddressField(const QString& lblAddr) { return lblAddr.split("/").last(); } + QString addressFromAddressField(const QString& lblAddr) { return lblAddr.trimmed().split("/").last(); } RPC* rpc = nullptr; QCompleter* labelCompleter = nullptr; diff --git a/src/sendtab.cpp b/src/sendtab.cpp index c804f05..01475bb 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -267,7 +267,7 @@ void MainWindow::setMemoEnabled(int number, bool enabled) { void MainWindow::memoButtonClicked(int number) { // Memos can only be used with zAddrs. So check that first auto addr = ui->sendToWidgets->findChild(QString("Address") + QString::number(number)); - if (!addr->text().trimmed().startsWith("z")) { + if (!addressFromAddressField(addr->text()).startsWith("z")) { QMessageBox msg(QMessageBox::Critical, "Memos can only be used with z-addresses", "The memo field can only be used with a z-address.\n" + addr->text() + "\ndoesn't look like a z-address", QMessageBox::Ok, this);