mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
rpc: add missing lock around chainman.ActiveTip()
This commit is contained in:
parent
88502ecf08
commit
f5ff3d773c
1 changed files with 1 additions and 1 deletions
|
|
@ -461,7 +461,7 @@ static RPCHelpMan getblockfrompeer()
|
|||
|
||||
// Fetching blocks before the node has syncing past their height can prevent block files from
|
||||
// being pruned, so we avoid it if the node is in prune mode.
|
||||
if (index->nHeight > chainman.ActiveChain().Tip()->nHeight && node::fPruneMode) {
|
||||
if (node::fPruneMode && index->nHeight > WITH_LOCK(chainman.GetMutex(), return chainman.ActiveTip()->nHeight)) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "In prune mode, only blocks that the node has already synced previously can be fetched from a peer");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue