diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-11-08 11:01:56 -0800 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-11-08 11:01:56 -0800 |
commit | 0fb0a38339e5cb404147c89f73ff10d962a47ca5 (patch) | |
tree | cab9da7d76601734e77c2682d930f8f4068b394e | |
parent | e1739cbf386dd7a6eb4f748f11eece300f813276 (diff) | |
parent | 9bc9593df56c2995fec1312d57225e4c887ee5ca (diff) |
Merge pull request #618 from laanwj/issue615
Fix segmentation fault when editing address not in address book (issue #615)
-rw-r--r-- | src/qt/editaddressdialog.cpp | 6 | ||||
-rw-r--r-- | src/qt/editaddressdialog.h | 1 | ||||
-rw-r--r-- | src/qt/transactionview.cpp | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp index b8e6fe4578..457e8cf0dc 100644 --- a/src/qt/editaddressdialog.cpp +++ b/src/qt/editaddressdialog.cpp @@ -113,3 +113,9 @@ QString EditAddressDialog::getAddress() const { return address; } + +void EditAddressDialog::setAddress(const QString &address) +{ + this->address = address; + ui->addressEdit->setText(address); +} diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h index 81086a45a8..9c9769d407 100644 --- a/src/qt/editaddressdialog.h +++ b/src/qt/editaddressdialog.h @@ -33,6 +33,7 @@ public: void accept(); QString getAddress() const; + void setAddress(const QString &address); private: bool saveCurrentRow(); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 92dda5784c..d39227c81f 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -322,6 +322,8 @@ void TransactionView::editLabel() // If this transaction has no associated address, exit 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); if(idx != -1) { @@ -343,6 +345,8 @@ void TransactionView::editLabel() // Add sending address EditAddressDialog dlg(EditAddressDialog::NewSendingAddress, this); + dlg.setModel(addressBook); + dlg.setAddress(address); dlg.exec(); } } |