Tests: IsReachable is the inverse of IsLimited (DRY) #15044

pull mmachicao wants to merge 2 commits into bitcoin:master from mmachicao:net_contract_test changing 2 files +306 −314
  1. mmachicao commented at 7:27 PM on December 27, 2018: contributor

    IsReachable is the inverse of IsLimited, but the implementation is duplicated (DRY)

    • Changed the implementation accordingly.
    • Added unittests to document behavior and relationship
    • Unittests have to reset values because of internal statefull variables.
    • My modification in net.cpp applies only to IsReachable.
    • Applied clang -> (unfortunately) lots of changes on formatting
  2. IsReachable is the inverse of IsLimited (DRY) c6aaecfd21
  3. Stateful value have to be resetted d492c263fe
  4. in src/net.cpp:180 in d492c263fe
     179 | -void AdvertiseLocal(CNode *pnode)
     180 | +void AdvertiseLocal(CNode* pnode)
     181 |  {
     182 | -    if (fListen && pnode->fSuccessfullyConnected)
     183 | -    {
     184 | +    if (fListen && pnode->fSuccessfullyConnected) {
    


    MarcoFalke commented at 7:34 PM on December 27, 2018:

    mmachicao commented at 1:01 AM on December 28, 2018:

    Hi MarkoFalke. I am afraid, appveyor will reject a file that is not fully formatted according to clang rules. Better bite the bullet now?


    MarcoFalke commented at 11:35 AM on December 28, 2018:

    We don't check formatting in appveyor. Do you have a failing build to link to?

  5. fanquake added the label Tests on Dec 27, 2018
  6. DrahtBot commented at 11:56 AM on December 28, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #14929 (net: Allow connections from misbehavior banned peers by gmaxwell)
    • #14897 (randomize GETDATA(tx) request order and introduce bias toward outbound by naumenkogs)
    • #14358 ([logs] Fix a few log messages related to duration measurement by romanz)
    • #14336 (net: implement poll by pstratem)
    • #14033 (p2p: Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater by Empact)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. mmachicao commented at 3:29 PM on December 28, 2018: contributor

    Closing this one. Am providing another pull request with the minimal change set.

    Note: Jsut reviewed. The conflicts with other pull requests are related exclusively to the application of clang format. Will create a pull request with clang format exclusively for my changed lines.

  8. mmachicao closed this on Dec 28, 2018

  9. laanwj referenced this in commit 854ca855ab on Jan 9, 2019
  10. PastaPastaPasta referenced this in commit 8cf5230dc1 on Jun 26, 2021
  11. PastaPastaPasta referenced this in commit 8223053a49 on Jun 28, 2021
  12. 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-22 00:14 UTC

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