Browse Source

Merge #11002: [wallet] return correct error code from resendwallettransaction

055d95f [wallet] return correct error code from resendwallettransaction (John Newbery)

Pull request description:

  New code in #10995 uses `RPC_INVALID_REQUEST`. According to the comment in rpc/protocol.h:
  ```
  // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).
  // It should not be used for application-layer errors.
  ```
  Change the returned error code to `RPC_WALLET_ERROR`

  #11000 will need to be updated to test for the correct error code.

Tree-SHA512: 0201b3a2091adf17ad301825da5bd29f0ea7e284b5394cbef80483fc293a558acc849f74a0780bb8501acab324fc722e41ae049cffec7afb76884e26df4b809e
0.15
Wladimir J. van der Laan 7 years ago
parent
commit
4268426b45
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D
  1. 2
      src/wallet/rpcwallet.cpp

2
src/wallet/rpcwallet.cpp

@ -2599,7 +2599,7 @@ UniValue resendwallettransactions(const JSONRPCRequest& request)
LOCK2(cs_main, pwallet->cs_wallet); LOCK2(cs_main, pwallet->cs_wallet);
if (!pwallet->GetBroadcastTransactions()) { if (!pwallet->GetBroadcastTransactions()) {
throw JSONRPCError(RPC_INVALID_REQUEST, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast"); throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast");
} }
std::vector<uint256> txids = pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get()); std::vector<uint256> txids = pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get());

Loading…
Cancel
Save