do not silently ignore errors on "backupwallet" RPC cmd

This commit is contained in:
Philip Kaufmann
2012-11-29 03:35:25 +00:00
committed by Luke Dashjr
parent 6247c53528
commit 2a9301b75a
+2 -1
View File
@@ -1255,7 +1255,8 @@ Value backupwallet(const Array& params, bool fHelp)
"Safely copies wallet.dat to destination, which can be a directory or a path with filename.");
string strDest = params[0].get_str();
BackupWallet(*pwalletMain, strDest);
if (!BackupWallet(*pwalletMain, strDest))
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet backup failed!");
return Value::null;
}