Return failure rather than asserting on WriteRecipientMapping failure.

Addresses https://github.com/zcash/zcash/pull/5700#discussion_r830538438
This commit is contained in:
Kris Nuttycombe 2022-03-20 12:30:18 -06:00
parent 9220ebb0de
commit 758852b281
1 changed files with 5 additions and 2 deletions

View File

@ -1715,11 +1715,14 @@ public:
{
sendRecipients[txid].push_back(recipient);
if (recipient.ua.has_value()) {
assert(CWalletDB(strWalletFile).WriteRecipientMapping(
if (!CWalletDB(strWalletFile).WriteRecipientMapping(
txid,
recipient.address,
recipient.ua.value()
));
)) {
LogPrintf("SaveRecipientMappings: Failed to write recipient mappings to the wallet database.");
return false;
};
}
}