Misc IRC fixes. #1745

pull gmaxwell wants to merge 2 commits into bitcoin:master from gmaxwell:irc_fixes changing 1 files +16 −5
  1. gmaxwell commented at 10:10 PM on August 28, 2012: contributor

    Don't force IRC off if not listening, do force it off if IPv4 is off.

    Previously Bitcoin would refuse to use IRC if it was either not accepting inbound connections or not making outbound. Instead this changes it to not use IRC only if it's not doing either or if IPv4 is off completely. If Bitcoin is not listening this will use the default random nicks rather than the IP based ones.

    Also,

    Don't retry a failing IRC nickname forever.

    If our IRC nick is in use (because some other node thinks it has the same address we think we have) don't fruitlessly try to reconnect using that name forever. After three tries, give up and use a random nick. Either we'll learn a new local address from IRC and switch to that, or it was right and the other guy is advertising for us.

    This avoids a pessimal case where a second testnet node behind a nat is unable to get any peers because he can't get on IRC.

  2. sipa commented at 10:26 PM on August 28, 2012: member

    I completely forgot about the case where you'd want IRC to find peers, instead of just advertizing yourself... ACK

  3. jgarzik commented at 10:30 PM on August 28, 2012: contributor

    ACK technical changes.

    ... but the comment style is wildly inconsistent.

  4. Don't force IRC off if not listening, do force it off if IPv4 is off.
    Previously Bitcoin would refuse to use IRC if it was either not
    accepting inbound connections or not making outbound. Instead this
    changes it to not use IRC only if it's not doing either or if
    IPv4 is off completely. If Bitcoin is not listening this will use
    the default random nicks rather than the IP based ones.
    3595b18793
  5. Don't retry a failing IRC nickname forever.
    If our IRC nick is in use (because some other node thinks it has
    the same address we think we have) don't fruitlessly try to reconnect
    using that name forever. After three tries, give up and use a random
    nick. Either we'll learn a new local address from IRC and switch
    to that, or it was right and the other guy is advertising for us.
    
    This avoids a pessimal case where a second testnet node behind
    a nat is unable to get any peers because he can't get on IRC.
    6a60c64c6b
  6. gmaxwell commented at 2:08 AM on August 29, 2012: contributor

    De-psychoed comments, added an additional small fix.

  7. jgarzik referenced this in commit 4445434a2d on Aug 29, 2012
  8. jgarzik merged this on Aug 29, 2012
  9. jgarzik closed this on Aug 29, 2012

  10. owlhooter referenced this in commit 32f21698e8 on Oct 10, 2018
  11. 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-18 21:16 UTC

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