NBitcoin: NBitcoin doesn't connect to the Bitcoin P2P network only on OSX under 8GB memory
Update. The AddressManager fails on OSX High Sierra under 8GB memory. It doesn’t fail with or over 8GB.
I created a repository that reproduces this issue with a few lines of code in the Program.cs
.
Repository: https://github.com/nopara73/NBitcoinBitcoinP2pOsxBug
I also added travis CI integration that shows it runs on Linux, but it doesn’t run on OSX. (It runs on Windows, too.)
Travis builds: https://travis-ci.org/nopara73/NBitcoinBitcoinP2pOsxBug/builds/344928253
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 38 (21 by maintainers)
I can make the tests pass simply changing the NodeConnectionParameters parameters (below my change):
The article Mac OSX Tuning says that
The article also says that the default new values for Settings for OSX Yosemite/Mavericks/Sierra are:
in NBitcoin, the default values are hardcoded as follow:
IMO, even when NBitcoin works perfectly well and can be parametrized easily, I think those defaults values should be modify in a way that osx programmers don’t have to deal with this. I’m not sure what the best strategy is (changing the values to fit the known max limits or let the default values or other)
This is not a blocker for us.
inject
TraceSourceFactory.CreateTraceSourceFactory
with an instance ofFunc<TraceSource>
. (see class NullTraceSource to see an empty implementation)