Browse Source

Fix segmentation fault when editing address not in address book (issue #615)

miguelfreitas
Wladimir J. van der Laan 13 years ago
parent
commit
9bc9593df5
  1. 6
      src/qt/editaddressdialog.cpp
  2. 1
      src/qt/editaddressdialog.h
  3. 4
      src/qt/transactionview.cpp

6
src/qt/editaddressdialog.cpp

@ -113,3 +113,9 @@ QString EditAddressDialog::getAddress() const
{ {
return address; return address;
} }
void EditAddressDialog::setAddress(const QString &address)
{
this->address = address;
ui->addressEdit->setText(address);
}

1
src/qt/editaddressdialog.h

@ -33,6 +33,7 @@ public:
void accept(); void accept();
QString getAddress() const; QString getAddress() const;
void setAddress(const QString &address);
private: private:
bool saveCurrentRow(); bool saveCurrentRow();

4
src/qt/transactionview.cpp

@ -322,6 +322,8 @@ void TransactionView::editLabel()
// If this transaction has no associated address, exit // If this transaction has no associated address, exit
return; return;
} }
// Is address in address book? Address book can miss address when a transaction is
// sent from outside the UI.
int idx = addressBook->lookupAddress(address); int idx = addressBook->lookupAddress(address);
if(idx != -1) if(idx != -1)
{ {
@ -343,6 +345,8 @@ void TransactionView::editLabel()
// Add sending address // Add sending address
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress, EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
this); this);
dlg.setModel(addressBook);
dlg.setAddress(address);
dlg.exec(); dlg.exec();
} }
} }

Loading…
Cancel
Save