mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Throw exception in gobject prepare when CommitTransaction fails
This commit is contained in:
parent
848f3389b4
commit
8d62e3f80e
@ -180,7 +180,9 @@ UniValue gobject(const JSONRPCRequest& request)
|
|||||||
CReserveKey reservekey(pwalletMain);
|
CReserveKey reservekey(pwalletMain);
|
||||||
// -- send the tx to the network
|
// -- send the tx to the network
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
pwalletMain->CommitTransaction(wtx, reservekey, g_connman.get(), state, NetMsgType::TX);
|
if (!pwalletMain->CommitTransaction(wtx, reservekey, g_connman.get(), state, NetMsgType::TX)) {
|
||||||
|
throw JSONRPCError(RPC_INTERNAL_ERROR, "CommitTransaction failed! Reason given: " + state.GetRejectReason());
|
||||||
|
}
|
||||||
|
|
||||||
DBG( cout << "gobject: prepare "
|
DBG( cout << "gobject: prepare "
|
||||||
<< " strData = " << govobj.GetDataAsString()
|
<< " strData = " << govobj.GetDataAsString()
|
||||||
|
Loading…
Reference in New Issue
Block a user