mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 21:04:58 +02:00
Remove p2pEnabled from Chain interface
RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.
This commit is contained in:
@@ -309,10 +309,6 @@ static CTransactionRef SendMoney(interfaces::Chain::Lock& locked_chain, CWallet
|
||||
if (nValue > curBalance)
|
||||
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds");
|
||||
|
||||
if (pwallet->GetBroadcastTransactions() && !pwallet->chain().p2pEnabled()) {
|
||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||
}
|
||||
|
||||
// Parse Bitcoin address
|
||||
CScript scriptPubKey = GetScriptForDestination(address);
|
||||
|
||||
@@ -845,10 +841,6 @@ static UniValue sendmany(const JSONRPCRequest& request)
|
||||
auto locked_chain = pwallet->chain().lock();
|
||||
LOCK(pwallet->cs_wallet);
|
||||
|
||||
if (pwallet->GetBroadcastTransactions() && !pwallet->chain().p2pEnabled()) {
|
||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||
}
|
||||
|
||||
if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Dummy value must be set to \"\"");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user