remove some unused functions #10501

pull benma wants to merge 1 commits into bitcoin:master from benma:unusedfuncs changing 6 files +0 −16
  1. benma commented at 5:15 PM on June 1, 2017: none

    Identified with cppcheck --enable=unusedFunction ..

    • GetSendBufferSize()'s last use removed in 991955e
    • SetPort()'s last use removed in 7e195e8
    • GetfLargeWorkInvalidChainFound() was introduced in e3ba0ef and never used
  2. practicalswift commented at 6:09 PM on June 1, 2017: contributor

    utACK ebd0c95

    Excellent! Can't believe I haven't found these myself :-)

  3. jonasschnelli commented at 6:34 PM on June 1, 2017: contributor

    I guess the wallet.h changes don't belong to this patch-set.

    Otherwise utACK.

  4. jonasschnelli added the label Refactoring on Jun 1, 2017
  5. benma force-pushed on Jun 1, 2017
  6. benma commented at 6:57 PM on June 1, 2017: none

    @jonasschnelli good catch, I actually removed the definition in wallet.h as well but it somehow didn't make it into the commit. I updated the commit. The rest is just trailing whitespace removed by my editor.

  7. dcousens approved
  8. MarcoFalke commented at 9:54 AM on June 2, 2017: member

    Could you mention the commits which removed the last use of the functions?

  9. benma force-pushed on Jun 2, 2017
  10. benma commented at 12:54 PM on June 2, 2017: none

    @MarcoFalke done.

  11. in src/netaddress.h:151 in e683fb117b outdated
     139 | @@ -140,7 +140,6 @@ class CService : public CNetAddr
     140 |          CService(const struct in_addr& ipv4Addr, unsigned short port);
     141 |          CService(const struct sockaddr_in& addr);
     142 |          void Init();
     143 | -        void SetPort(unsigned short portIn);
    


    paveljanik commented at 12:59 PM on June 2, 2017:

    Although not used, this is nice setter...


    benma commented at 1:15 PM on June 2, 2017:

    Still, unused code is just dead weight and confusing. In this case, it implies that something external to the class is setting the port, but nothing is.

  12. laanwj commented at 12:50 PM on June 5, 2017: member

    Please don't remove GetDestData. It is part of a Set/Remove/Get API, which makes no sense without that function.I've commented on this before, people keep trying to remove it. See also #4183. Maybe we should add a comment in the source code.

    Also a use is introduced in #10386.

  13. benma force-pushed on Jun 6, 2017
  14. benma commented at 11:25 AM on June 6, 2017: none

    @laanwj thanks, I restored GetDestData().

  15. fanquake commented at 10:36 AM on June 14, 2017: member

    utACK 65c993c

  16. practicalswift commented at 2:43 PM on June 14, 2017: contributor

    utACK 65c993c07ede6fb1616a5e4843753b16c252ef4d

  17. paveljanik commented at 6:48 PM on June 14, 2017: contributor

    utACK 65c993c

  18. paveljanik commented at 1:56 PM on June 27, 2017: contributor

    Needs rebase

  19. benma force-pushed on Jul 13, 2017
  20. benma commented at 10:08 AM on July 13, 2017: none

    Rebased.

  21. in src/net.h:245 in aa6c46009f outdated
     241 | @@ -242,7 +242,7 @@ class CConnman
     242 |      bool DisconnectNode(const std::string& node);
     243 |      bool DisconnectNode(NodeId id);
     244 |  
     245 | -    unsigned int GetSendBufferSize() const;
     246 | +    void AddWhitelistedRange(const CSubNet &subnet);
    


    TheBlueMatt commented at 7:25 PM on July 14, 2017:

    Wait, bad rebase here?


    benma commented at 7:46 PM on July 14, 2017:

    Yes :fearful: good catch, thank you. Fixed.

  22. benma force-pushed on Jul 14, 2017
  23. TheBlueMatt commented at 10:49 PM on July 14, 2017: member

    utACK

  24. remove some unused functions
    Identified with `cppcheck --enable=unusedFunction .`.
    
     - GetSendBufferSize()'s last use removed in
       991955ee81034dc3fbc1c2a8e60c04fc9e0b538c
     - SetPort()'s last use removed in
       7e195e8459ad741368db6bb574981fccb1707268
     - GetfLargeWorkInvalidChainFound() was introduced in
       e3ba0ef95636290a3bb597ddd25d13ea13b034aa and never used
    f228b8e163
  25. benma force-pushed on Jul 22, 2017
  26. benma commented at 7:56 AM on July 22, 2017: none

    Rebased.

  27. practicalswift commented at 7:28 PM on July 22, 2017: contributor

    utACK f228b8e16308ef33792f54360f0f2c2f8310b158

  28. laanwj merged this on Jul 27, 2017
  29. laanwj closed this on Jul 27, 2017

  30. laanwj referenced this in commit 8a99fe053a on Jul 27, 2017
  31. PastaPastaPasta referenced this in commit 9e7cea8303 on Sep 4, 2019
  32. PastaPastaPasta referenced this in commit 11e052fd41 on Sep 4, 2019
  33. PastaPastaPasta referenced this in commit 17ec4522ca on Sep 8, 2019
  34. PastaPastaPasta referenced this in commit 3b7d3c90d9 on Sep 8, 2019
  35. barrystyle referenced this in commit 89bf1b684e on Jan 22, 2020
  36. 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: 2026-04-22 06:15 UTC

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