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
  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. 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.
  11. NicolasDorier commented at 9:35 am on May 3, 2017: contributor
    utACK
  12. 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
  13. laanwj merged this on May 3, 2017
  14. laanwj closed this on May 3, 2017

  15. laanwj referenced this in commit 22d870016e on May 3, 2017
  16. MarcoFalke 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: 2025-10-07 18:13 UTC

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