mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
rpc: allow getblocktemplate for test chains when unconnected or in IBD
This commit is contained in:
parent
81c54dec20
commit
95d5d5e625
1 changed files with 8 additions and 4 deletions
|
|
@ -658,11 +658,15 @@ static RPCHelpMan getblocktemplate()
|
||||||
if(!node.connman)
|
if(!node.connman)
|
||||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||||
|
|
||||||
if (node.connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
|
if (!Params().IsTestChain()) {
|
||||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!");
|
if (node.connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0) {
|
||||||
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!");
|
||||||
|
}
|
||||||
|
|
||||||
if (::ChainstateActive().IsInitialBlockDownload())
|
if (::ChainstateActive().IsInitialBlockDownload()) {
|
||||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks...");
|
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned int nTransactionsUpdatedLast;
|
static unsigned int nTransactionsUpdatedLast;
|
||||||
const CTxMemPool& mempool = EnsureMemPool(request.context);
|
const CTxMemPool& mempool = EnsureMemPool(request.context);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue