We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88502ec commit f5ff3d7Copy full SHA for f5ff3d7
src/rpc/blockchain.cpp
@@ -461,7 +461,7 @@ static RPCHelpMan getblockfrompeer()
461
462
// Fetching blocks before the node has syncing past their height can prevent block files from
463
// being pruned, so we avoid it if the node is in prune mode.
464
- if (index->nHeight > chainman.ActiveChain().Tip()->nHeight && node::fPruneMode) {
+ if (node::fPruneMode && index->nHeight > WITH_LOCK(chainman.GetMutex(), return chainman.ActiveTip()->nHeight)) {
465
throw JSONRPCError(RPC_MISC_ERROR, "In prune mode, only blocks that the node has already synced previously can be fetched from a peer");
466
}
467
0 commit comments