Esempio n. 1
0
 public static NBitcoin.RPC.RPCClient GetLocalRPCClient()
 {
     if (_rpcclient == null)
     {
         NBitcoin.RPC.RPCCredentialString r = new NBitcoin.RPC.RPCCredentialString();
         System.Net.NetworkCredential     t = new System.Net.NetworkCredential(GetBMSConfigurationKeyValue("rpcuser"), GetBMSConfigurationKeyValue("rpcpassword"));
         r.UserPassword = t;
         string sHost             = GetBMSConfigurationKeyValue("rpchost");
         NBitcoin.RPC.RPCClient n = new NBitcoin.RPC.RPCClient(r, sHost, NBitcoin.Network.BiblepayMain);
         _rpcclient = n;
         return(n);
     }
     else
     {
         try
         {
             var nbal = _rpcclient.GetBalance();
         }
         catch (Exception)
         {
             _rpcclient = null;
             return(GetLocalRPCClient());
         }
         return(_rpcclient);
     }
 }
Esempio n. 2
0
        public static NBitcoin.RPC.RPCClient GetTestNetRPCClient()
        {
            NBitcoin.RPC.RPCCredentialString r = new NBitcoin.RPC.RPCCredentialString();
            System.Net.NetworkCredential     t = new System.Net.NetworkCredential(GetBMSConfigurationKeyValue("testnetrpcuser"), GetBMSConfigurationKeyValue("testnetrpcpassword"));
            r.UserPassword = t;
            string sHost = GetBMSConfigurationKeyValue("testnetrpchost");

            NBitcoin.RPC.RPCClient n = new NBitcoin.RPC.RPCClient(r, sHost, NBitcoin.Network.BiblepayTest);
            return(n);
        }