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 // Add entry
{ wallet->SetAddressBook(DecodeDestination(strAddress), strLabel,
LOCK(wallet->cs_wallet); (type == Send ? "send" : "receive"));
wallet->SetAddressBook(DecodeDestination(strAddress), strLabel,
(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;
} }
{ wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));
LOCK(wallet->cs_wallet);
wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));
}
return true; return true;
} }