Browse Source

#34 Properly validate address field when there is a label

import_zecw
adityapk00 6 years ago
parent
commit
02eb051e78
  1. 2
      src/mainwindow.h
  2. 5
      src/sendtab.cpp

2
src/mainwindow.h

@ -92,6 +92,8 @@ private:
void restoreSavedStates();
QString addressFromAddressField(const QString& lblAddr) { return lblAddr.split("/").last(); }
RPC* rpc = nullptr;
QCompleter* labelCompleter = nullptr;

5
src/sendtab.cpp

@ -244,7 +244,8 @@ void MainWindow::addAddressSection() {
}
void MainWindow::addressChanged(int itemNumber, const QString& text) {
setMemoEnabled(itemNumber, text.startsWith("z"));
auto addr = addressFromAddressField(text);
setMemoEnabled(itemNumber, addr.startsWith("z"));
}
void MainWindow::amountChanged(int item, const QString& text) {
@ -376,7 +377,7 @@ Tx MainWindow::createTxFromSendPage() {
for (int i=0; i < totalItems; i++) {
QString addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") % QString::number(i+1))->text().trimmed();
// Remove label if it exists
addr = addr.split("/").last();
addr = addressFromAddressField(addr);
double amt = ui->sendToWidgets->findChild<QLineEdit*>(QString("Amount") % QString::number(i+1))->text().trimmed().toDouble();
QString memo = ui->sendToWidgets->findChild<QLabel*>(QString("MemoTxt") % QString::number(i+1))->text().trimmed();

Loading…
Cancel
Save