Skip to content

Commit d6f3a73

Browse files
Remove redundant locks
* SetAddressBook(...) is locking cs_wallet internally * DelAddressBook(...) is locking cs_wallet internally
1 parent 5197100 commit d6f3a73

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/qt/addresstablemodel.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,8 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
392392
}
393393

394394
// Add entry
395-
{
396-
LOCK(wallet->cs_wallet);
397-
wallet->SetAddressBook(DecodeDestination(strAddress), strLabel,
398-
(type == Send ? "send" : "receive"));
399-
}
395+
wallet->SetAddressBook(DecodeDestination(strAddress), strLabel,
396+
(type == Send ? "send" : "receive"));
400397
return QString::fromStdString(strAddress);
401398
}
402399

@@ -410,10 +407,7 @@ bool AddressTableModel::removeRows(int row, int count, const QModelIndex &parent
410407
// Also refuse to remove receiving addresses.
411408
return false;
412409
}
413-
{
414-
LOCK(wallet->cs_wallet);
415-
wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));
416-
}
410+
wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));
417411
return true;
418412
}
419413

0 commit comments

Comments
 (0)