diff options
author | Jeff Garzik <jgarzik@exmulti.com> | 2012-05-14 01:11:11 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2012-05-14 01:11:11 -0400 |
commit | 0fb78eae34b870b9e5b942095d340f2aae49cd60 (patch) | |
tree | e572b79b017afe24d74fdbb89b0ee3f5fe635833 /src/bitcoinrpc.cpp | |
parent | 09b4e26a446c302f0cce176bf572da956bb2515e (diff) |
Always check return values of TxnBegin() and TxnCommit()
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r-- | src/bitcoinrpc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index e058978ebf..8e4361c92a 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1037,7 +1037,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(); @@ -1059,7 +1060,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; } |