From a19338723d662e6fc0571833d2b9983e1914f282 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 20 Aug 2015 15:50:13 -0400 Subject: [PATCH 1/2] net: Set SO_REUSEADDR for Windows too When running the rpc tests in Wine, nodes often fail to listen on localhost due to a stale socket from a previous run. This aligns the behavior with other platforms. --- src/net.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index fb5726a2b..8fda5140c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1625,8 +1625,10 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int)); #endif // Allow binding if the port is still in TIME_WAIT state after - // the program was closed and restarted. Not an issue on windows! + // the program was closed and restarted. setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int)); +#else + setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&nOne, sizeof(int)); #endif // Set to non-blocking, incoming connections will also inherit this From bd30c3dced21fca869a14c75081f15195762afe1 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 25 Aug 2015 12:03:28 -0400 Subject: [PATCH 2/2] rpc-tests: re-enable rpc-tests for Windows --- qa/pull-tester/rpc-tests.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index 5d581819d..555d2c224 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -8,11 +8,6 @@ CURDIR=$(cd $(dirname "$0"); pwd) export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli export BITCOIND=${REAL_BITCOIND} -if [ "x${EXEEXT}" = "x.exe" ]; then - echo "Win tests currently disabled" - exit 0 -fi - #Run the tests testScripts=(