Small bug in db.cpp #424

issue xanatos opened this issue on July 22, 2011
  1. xanatos commented at 6:52 AM on July 22, 2011: none

    Line 531 of db.cpp: CAddress addr(psz, NODE_NETWORK);

    BUT the relevant constructors of CAddress (those starting with a char*) are:

    explicit CAddress(const char* pszIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK) explicit CAddress(const char* pszIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK)

    so the first constructor is called and portIn = NODE_NETWORK. Probably there isn't any difference (the port isn't really necessary, all that is done in db.cpp is checking if the address is valid), but the code should be:

    CAddress addr(psz, false, NODE_NETWORK);

    or more simply

    CAddress addr(psz);

  2. jgarzik referenced this in commit a139ed74f2 on Jul 26, 2011
  3. jgarzik commented at 7:16 PM on July 26, 2011: contributor

    fixed

  4. jgarzik closed this on Jul 26, 2011

  5. classesjack referenced this in commit 78affdb357 on Jan 2, 2018
  6. Losangelosgenetics referenced this in commit b96ceee8b6 on Mar 12, 2020
  7. rajarshimaitra referenced this in commit 66a7083d51 on Aug 5, 2021
  8. DrahtBot locked this on Sep 8, 2021
Contributors

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-29 03:16 UTC

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