aboutsummaryrefslogtreecommitdiff
path: root/src/qt/addresstablemodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-07-07 15:22:54 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-07-07 15:22:54 +0200
commitae3d0aba158d0a38c33d687e5473d688fbcb903d (patch)
tree33aad906eba0bf0500a24196649651bd8d48dfa4 /src/qt/addresstablemodel.cpp
parentfbaee7a8533b23d846ee16837320f709c4e83d47 (diff)
Sync to bitcoin git e94010b2395694d56dd6
Diffstat (limited to 'src/qt/addresstablemodel.cpp')
-rw-r--r--src/qt/addresstablemodel.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp
index e375ff8cbc..d04989ea2e 100644
--- a/src/qt/addresstablemodel.cpp
+++ b/src/qt/addresstablemodel.cpp
@@ -165,10 +165,13 @@ bool AddressTableModel::setData(const QModelIndex & index, const QVariant & valu
// Double-check that we're not overwriting receiving address
if(rec->type == AddressTableEntry::Sending)
{
- // Remove old entry
- wallet->EraseAddressBookName(rec->address.toStdString());
- // Add new entry with new address
- wallet->SetAddressBookName(value.toString().toStdString(), rec->label.toStdString());
+ CRITICAL_BLOCK(wallet->cs_mapAddressBook)
+ {
+ // Remove old entry
+ wallet->DelAddressBookName(rec->address.toStdString());
+ // Add new entry with new address
+ wallet->SetAddressBookName(value.toString().toStdString(), rec->label.toStdString());
+ }
rec->address = value.toString();
}
@@ -274,7 +277,10 @@ bool AddressTableModel::removeRows(int row, int count, const QModelIndex & paren
// Also refuse to remove receiving addresses.
return false;
}
- wallet->EraseAddressBookName(rec->address.toStdString());
+ CRITICAL_BLOCK(wallet->cs_mapAddressBook)
+ {
+ wallet->DelAddressBookName(rec->address.toStdString());
+ }
updateList();
return true;
}