MapPort when not USE_UPNP #450

issue xanatos opened this issue on August 3, 2011
  1. xanatos commented at 2:12 PM on August 3, 2011: none

    In net.cpp there is a MapPort method. This method is compiled only when the USE_UPNP is defined BUT in various places it's called without checking for USE_UPNP (in net.cpp in method StartNode around line 1699 and in ui.cpp in method OnButtonApply around line 1784). The VC++ doesn't like it.

    Three things can be done:

    • delete the USE_UPNP define and always compile the code (but this could have problems for systems without the library)
    • protect the two calls with #ifdef
    • put an #else in net.cpp and define an empty MapPort that does nothing.
  2. TheBlueMatt commented at 6:46 PM on August 3, 2011: member

    Each call is within an if(fHaveUPnP) which means the compiler will optimize it out (since fHaveUPnP is a constant). That way you dont have messy ifdefs all over the place.

  3. xanatos commented at 7:02 PM on August 3, 2011: none

    You have to tell it to the VC++. Probably the gcc is more flexible (in the same way that the gcc ignore the missing return value of AddKey)

  4. TheBlueMatt commented at 7:06 PM on August 3, 2011: member

    VC++ isnt officially supported (due to odd GUI crap that can happen which causes parts of the GUI to become transparent). Last I heard the current makefile for vc will compiled properly anyway (someone updated it not too long ago).

  5. gavinandresen closed this on Aug 9, 2011

  6. zathras-crypto referenced this in commit afb0c58e0b on Jan 24, 2017
  7. gandrewstone referenced this in commit 6983132815 on Apr 26, 2017
  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