aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 4426ac502e..93c9b4110a 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -840,7 +840,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();
@@ -862,7 +863,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;
}