Skip to content

Commit

Permalink
Bugfix: GUI: Disable editing of sending addresses
Browse files Browse the repository at this point in the history
This has been broken since 0.17 and nobody noticed, so just remove it entirely.

Bug 1 (since 0.17, bitcoin#10244): Instead of moving the label, the new address's label was set to the new address itself, and the actual label was lost completely.

Bug 2 (since 0.19, bitcoin#13756): "used" DestData should have been retained at the old address rather than deleted entirely.

Bug 3: Editing both the label and address in the label-editing dialog would still delete the label for the old address.

This commit just turns off the GUI editing capabilities, which should be the minimal needed to disable the functionality and therefore the bugs.
  • Loading branch information
luke-jr committed May 6, 2020
1 parent 8a9ffec commit 0e9e25a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/qt/addresstablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ Qt::ItemFlags AddressTableModel::flags(const QModelIndex &index) const
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
// Can edit address and label for sending addresses,
// and only label for receiving addresses.
if(rec->type == AddressTableEntry::Sending ||
(rec->type == AddressTableEntry::Receiving && index.column()==Label))
{
if ((rec->type == AddressTableEntry::Sending || rec->type == AddressTableEntry::Receiving) && index.column() == Label) {
retval |= Qt::ItemIsEditable;
}
return retval;
Expand Down
1 change: 1 addition & 0 deletions src/qt/editaddressdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
break;
case EditSendingAddress:
setWindowTitle(tr("Edit sending address"));
ui->addressEdit->setEnabled(false);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/forms/addressbookpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="toolTip">
<string>Right-click to edit address or label</string>
<string>Right-click to edit label</string>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
Expand Down

0 comments on commit 0e9e25a

Please sign in to comment.