mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
Always check return values of TxnBegin() and TxnCommit()
PARTIAL, since d68dcf7 isn't backported (yet)
This commit is contained in:
@@ -723,7 +723,8 @@ Value movecmd(const Array& params, bool fHelp)
|
||||
strComment = params[4].get_str();
|
||||
|
||||
CWalletDB walletdb(pwalletMain->strWalletFile);
|
||||
walletdb.TxnBegin();
|
||||
if (!walletdb.TxnBegin())
|
||||
throw JSONRPCError(-20, "database error");
|
||||
|
||||
int64 nNow = GetAdjustedTime();
|
||||
|
||||
@@ -745,7 +746,8 @@ Value movecmd(const Array& params, bool fHelp)
|
||||
credit.strComment = strComment;
|
||||
walletdb.WriteAccountingEntry(credit);
|
||||
|
||||
walletdb.TxnCommit();
|
||||
if (!walletdb.TxnCommit())
|
||||
throw JSONRPCError(-20, "database error");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user