diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-02-14 17:25:57 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-02-14 17:26:53 +0100 |
commit | e782099a151a680523cd8ff5e3fcb9d5cc182bdd (patch) | |
tree | beec2c41d354e8ca7174e2a9a29d7c3d0c0f2e75 /src/qt/addresstablemodel.cpp | |
parent | 6bb9c13f9a2b0ff1328b7605d4b901a646ab35fd (diff) | |
parent | d6f3a737361d8fb562f08763f613a6529b870d1e (diff) |
Merge #11733: qt: Remove redundant locks
d6f3a73 Remove redundant locks (practicalswift)
Pull request description:
Remove redundant locks:
* ~~`FindNode(...)` is locking `cs_vNodes` internally~~
* `SetAddressBook(...)` is locking `cs_wallet` internally
* `DelAddressBook(...)` is locking `cs_wallet` internally
**Note to reviewers:** From what I can tell these locks are redundantly held from a data integrity perspective (guarding specific variables), and they do not appear to be needed from a data consistency perspective (ensuring a consistent state at the right points). Review thoroughly and please let me know if I'm mistaken :-)
Tree-SHA512: 7e3ca2d52fecb16385dc65051b5b20d81b502c0025d70b0c489eb3881866bdd57947a9c96931f7b213f5a8a76b6d2c7b084dff0ef2028a1e9ca9ccfd83e5b91e
Diffstat (limited to 'src/qt/addresstablemodel.cpp')
-rw-r--r-- | src/qt/addresstablemodel.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index 74f0db3520..ffb5bff4de 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -393,11 +393,8 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con } // Add entry - { - LOCK(wallet->cs_wallet); - wallet->SetAddressBook(DecodeDestination(strAddress), strLabel, - (type == Send ? "send" : "receive")); - } + wallet->SetAddressBook(DecodeDestination(strAddress), strLabel, + (type == Send ? "send" : "receive")); return QString::fromStdString(strAddress); } @@ -411,10 +408,7 @@ bool AddressTableModel::removeRows(int row, int count, const QModelIndex &parent // Also refuse to remove receiving addresses. return false; } - { - LOCK(wallet->cs_wallet); - wallet->DelAddressBook(DecodeDestination(rec->address.toStdString())); - } + wallet->DelAddressBook(DecodeDestination(rec->address.toStdString())); return true; } |