Remove redundant locks

* SetAddressBook(...) is locking cs_wallet internally
* DelAddressBook(...) is locking cs_wallet internally
This commit is contained in:
practicalswift 2017-11-21 10:17:39 +01:00
parent 5197100704
commit d6f3a73736

View file

@ -392,11 +392,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);
}
@ -410,10 +407,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;
}