Consistently use FormatStateMessage in RPC error output

This will include the error code and debug output as well as the reason string.

See #11955 for the motivation.
This commit is contained in:
Ben Woosley
2018-02-06 18:47:51 -05:00
parent 8b8a1c4f8b
commit bb00c95c16
9 changed files with 15 additions and 16 deletions

View File

@@ -267,7 +267,7 @@ Result CommitTransaction(CWallet* wallet, const uint256& txid, CMutableTransacti
CValidationState state;
if (!wallet->CommitTransaction(wtxBumped, reservekey, g_connman.get(), state)) {
// NOTE: CommitTransaction never returns false, so this should never happen.
errors.push_back(strprintf("The transaction was rejected: %s", state.GetRejectReason()));
errors.push_back(strprintf("The transaction was rejected: %s", FormatStateMessage(state)));
return Result::WALLET_ERROR;
}
@@ -290,4 +290,3 @@ Result CommitTransaction(CWallet* wallet, const uint256& txid, CMutableTransacti
}
} // namespace feebumper