Add mruset and use it for setInventoryKnown #907

pull sipa wants to merge 1 commits into bitcoin:master from sipa:mruinventory changing 4 files +157 −1
  1. sipa commented at 5:15 PM on February 27, 2012: member

    This prevents unbounded memory usage when a attacker spams a node with "inv" messages.

  2. Add mruset and use it for setInventoryKnown c4341fa6ab
  3. in src/mruset.h:None in ea5caf7e52 outdated
      26 | +    iterator end() const { return set.end(); }
      27 | +    size_type size() const { return set.size(); }
      28 | +    bool empty() const { return set.empty(); }
      29 | +    iterator find(const key_type& k) const { return set.find(k); }
      30 | +    size_type count(const key_type& k) const { return set.count(k); }
      31 | +    bool inline friend operator==(const mruset& a, const mruset& b) { return a.set() == a.set(); }
    


    gavinandresen commented at 8:03 PM on February 27, 2012:

    typo: == b.set()


    sipa commented at 8:05 PM on February 27, 2012:

    Seems I forgot to add the changes to this file to the commit; fixed

  4. gavinandresen commented at 8:45 PM on February 27, 2012: contributor

    ACK

  5. gavinandresen merged this on Feb 28, 2012
  6. gavinandresen closed this on Feb 28, 2012

  7. ptschip referenced this in commit 306a2057ae on Jan 12, 2018
  8. ptschip referenced this in commit dde2d83c44 on Jan 17, 2018
  9. dexX7 referenced this in commit 4a252329d8 on Apr 4, 2019
  10. sipa referenced this in commit 77ccaf5cb9 on Apr 2, 2021
  11. sipa referenced this in commit cb8f70f488 on Apr 2, 2021
  12. sipa referenced this in commit a110aca93f on Apr 2, 2021
  13. sipa referenced this in commit bdca9bcb6c on Apr 23, 2021
  14. rebroad referenced this in commit 6e13b4e771 on Jun 23, 2021
  15. DrahtBot 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-19 09:16 UTC

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