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
1 changed files with 3 additions and 9 deletions

View File

@ -392,11 +392,8 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
} }
// Add entry // Add entry
{
LOCK(wallet->cs_wallet);
wallet->SetAddressBook(DecodeDestination(strAddress), strLabel, wallet->SetAddressBook(DecodeDestination(strAddress), strLabel,
(type == Send ? "send" : "receive")); (type == Send ? "send" : "receive"));
}
return QString::fromStdString(strAddress); return QString::fromStdString(strAddress);
} }
@ -410,10 +407,7 @@ bool AddressTableModel::removeRows(int row, int count, const QModelIndex &parent
// Also refuse to remove receiving addresses. // Also refuse to remove receiving addresses.
return false; return false;
} }
{
LOCK(wallet->cs_wallet);
wallet->DelAddressBook(DecodeDestination(rec->address.toStdString())); wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));
}
return true; return true;
} }