Remove unused args from GetFetchFlags() #10311

pull btcdrak wants to merge 1 commits into bitcoin:master from btcdrak:getflags changing 1 files +9 −9
  1. btcdrak commented at 7:44 AM on May 2, 2017: contributor

    No description provided.

  2. Remove unused args from GetFetchhFlags() 1ff2bb4e3e
  3. dcousens approved
  4. dcousens commented at 8:11 AM on May 2, 2017: contributor

    utACK

  5. kallewoof approved
  6. fanquake added the label Refactoring on May 2, 2017
  7. practicalswift commented at 2:04 PM on May 2, 2017: contributor

    utACK

    Nice find! Can't believe I didn't catch this one myself :-)

  8. in src/net_processing.cpp:1165 in 1ff2bb4e3e
    1161 | @@ -1162,7 +1162,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
    1162 |      }
    1163 |  }
    1164 |  
    1165 | -uint32_t GetFetchFlags(CNode* pfrom, const CBlockIndex* pprev, const Consensus::Params& chainparams) {
    1166 | +uint32_t GetFetchFlags(CNode* pfrom) {
    


    laanwj commented at 5:33 PM on May 2, 2017:

    Any idea why these were being passed? Looked back in history and to me it seems that CBlockIndex* pprev, const Consensus::Params& chainparams were never used at all, since introduced in b8a97498df1e83f8dcc49bc3fa4344f9e9799242. @sipa @NicolasDorier maybe?


    NicolasDorier commented at 6:59 AM on May 3, 2017:

    Before GetFetchFlags was using IsWitnessEnabled, not fHaveWitnessand GetLocalServices

  9. paveljanik commented at 5:59 PM on May 2, 2017: contributor

    super-micro nit: can you please correct the function name in the commit message?

  10. practicalswift cross-referenced this on May 2, 2017 from issue Remove unused argument from MarkBlockAsInFlight(...) by practicalswift
  11. sipa commented at 7:06 AM on May 3, 2017: member

    Yeah, in older versions of the SegWit patch, fetch flags were based on the chain instead of explicit announcements. That led to too many edge cases to deal with, however. The dependency on pprev/params can safely go away.

  12. NicolasDorier commented at 9:35 AM on May 3, 2017: contributor

    utACK

  13. laanwj commented at 9:44 AM on May 3, 2017: member

    @sipa @NicolasDorier thanks for the explanation, so this change makes sense in that context utACK 1ff2bb4

  14. laanwj merged this on May 3, 2017
  15. laanwj closed this on May 3, 2017

  16. laanwj referenced this in commit 22d870016e on May 3, 2017
  17. bitcoin locked this on Sep 8, 2021

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-05-20 06:55 UTC