The problem of repeated calls #24996

issue guoyl opened this issue on April 27, 2022
  1. guoyl commented at 3:23 AM on April 27, 2022: none

    In the https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp void PeerManagerImpl::FindNextBlocksToDownload(.....) ...... for (const CBlockIndex* pindex : vToFetch) { if (!pindex->IsValid(BLOCK_VALID_TREE)) { // We consider the chain that this peer is on invalid. return; } if (!State(nodeid)->fHaveWitness && DeploymentActiveAt(*pindex, consensusParams, Consensus::DEPLOYMENT_SEGWIT)) { // We wouldn't download this block or its descendants from this peer. return; } ...... In fact, the State(nodeid) returns variable is already initialized at the beginning of the function, there is no need to repeat the call here. In addition, the fHaveWitness is only set in the NetMsgType::VERSION phase.

  2. MarcoFalke commented at 6:28 AM on April 27, 2022: member

    Pretty sure this will be fixed as part of #19398

  3. MarcoFalke closed this on Apr 27, 2022

  4. DrahtBot locked this on Apr 27, 2023
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me