Init net subsystem
authorCryptoManiac <balthazar.ad@gmail.com>
Mon, 20 Dec 2021 21:17:34 +0000 (00:17 +0300)
committerCryptoManiac <balthazar.ad@gmail.com>
Mon, 20 Dec 2021 21:17:34 +0000 (00:17 +0300)
src/bitcoinrpc.cpp

index 3f52156..2450ca4 100644 (file)
@@ -480,7 +480,10 @@ static CCriticalSection cs_THREAD_RPCHANDLER;
 
 void StartRPCServer()
 {
-strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
+    // Init net subsystem
+    ix::initNetSystem();
+
+    strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
     if (mapArgs["-rpcpassword"].empty())
     {
         unsigned char rand_pwd[32];
@@ -645,6 +648,9 @@ Object CallRPC(const string& strMethod, const Array& params)
               "If the file does not exist, create it with owner-readable-only file permissions."),
                 GetConfigFile().string().c_str()));
 
+    // Init net subsystem
+    ix::initNetSystem();
+
     // Create HTTP client
     ix::HttpClient httpClient;
     ix::HttpRequestArgsPtr args = httpClient.createRequest();