diff options
| author | John Newbery <[email protected]> | 2017-02-09 15:48:39 -0500 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2017-06-05 19:01:16 +0000 |
| commit | f5efe82a832a050d1e8f483904913d238dde2e93 (patch) | |
| tree | fe3477c6002175c401abcdc76f3c7a61b14248fb /src/wallet/rpcwallet.cpp | |
| parent | Return correct error codes in setban(). (diff) | |
| download | discoin-f5efe82a832a050d1e8f483904913d238dde2e93.tar.xz discoin-f5efe82a832a050d1e8f483904913d238dde2e93.zip | |
Return correct error codes in fundrawtransaction().
The fundrawtransaction() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when funding the transaction
failed). This commit fixes those error codes:
- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.
That error code has been replaced with RPC_WALLET_ERROR.
This commit also updates the test cases to explicitly test the error code.
Github-Pull: #9853
Rebased-From: dab804c18a427901684ebe936b2069a97e04a268
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index c141c0ca1..7cc032016 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2657,7 +2657,7 @@ UniValue fundrawtransaction(const JSONRPCRequest& request) string strFailReason; if(!pwalletMain->FundTransaction(tx, nFeeOut, overrideEstimatedFeerate, feeRate, changePosition, strFailReason, includeWatching, lockUnspents, setSubtractFeeFromOutputs, reserveChangeKey, changeAddress)) - throw JSONRPCError(RPC_INTERNAL_ERROR, strFailReason); + throw JSONRPCError(RPC_WALLET_ERROR, strFailReason); UniValue result(UniValue::VOBJ); result.push_back(Pair("hex", EncodeHexTx(tx))); |