aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-08-05 13:48:37 -0400
committerMatt Corallo <git@bluematt.me>2017-08-06 21:40:56 -0400
commit01699fb283485918478017331872c75817b81bdb (patch)
tree60801a38d7872abaca38bd6a73288292ae0f9c77 /src/wallet/rpcwallet.cpp
parenta9dd11144152bf40fa797cc0b0c8857c03d3ad6a (diff)
downloadbitcoin-01699fb283485918478017331872c75817b81bdb.tar.xz
Fix resendwallettransactions assert failure if -walletbroadcast=0
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index a7c229fa74..27f84bfb7c 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2589,6 +2589,7 @@ UniValue resendwallettransactions(const JSONRPCRequest& request)
"Immediately re-broadcast unconfirmed wallet transactions to all peers.\n"
"Intended only for testing; the wallet code periodically re-broadcasts\n"
"automatically.\n"
+ "Returns an RPC error if -walletbroadcast is set to false.\n"
"Returns array of transaction ids that were re-broadcast.\n"
);
@@ -2597,6 +2598,10 @@ UniValue resendwallettransactions(const JSONRPCRequest& request)
LOCK2(cs_main, pwallet->cs_wallet);
+ if (!pwallet->GetBroadcastTransactions()) {
+ throw JSONRPCError(RPC_INVALID_REQUEST, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast");
+ }
+
std::vector<uint256> txids = pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get());
UniValue result(UniValue::VARR);
for (const uint256& txid : txids)