Exemplo n.º 1
0
        public ChannelInfoResponse Get(string cryptoCode)
        {
            var n       = _networkProvider.GetByCryptoCode(cryptoCode.ToLowerInvariant());
            var peer    = _peerManagerProvider.TryGetPeerManager(n);
            var details = peer.ChannelManager.ListChannels(_pool);

            return(new ChannelInfoResponse {
                Details = details
            });
        }
Exemplo n.º 2
0
 public NBXplorerListeners(NRustLightningNetworkProvider networkProvider, INBXplorerClientProvider clientProvider, IPeerManagerProvider peerManagerProvider, ILoggerFactory loggerFactory,
                           ChannelProvider channelProvider)
 {
     foreach (var n in networkProvider.GetAll())
     {
         var cli     = clientProvider.TryGetClient(n);
         var peerMan = peerManagerProvider.TryGetPeerManager(n);
         if (cli != null && peerMan != null)
         {
             var listener = new NBXplorerListener(cli, peerMan, loggerFactory.CreateLogger <NBXplorerListener>(), channelProvider.GetFeeRateChannel(n).Writer);
             _listeners.TryAdd(n.CryptoCode, listener);
         }
     }
 }
Exemplo n.º 3
0
 public RustLightningEventReactor(
     P2PConnectionHandler connectionHandler,
     IPeerManagerProvider peerManagerProvider,
     IWalletService walletService,
     NRustLightningNetwork network,
     EventAggregator eventAggregator,
     ILogger logger,
     IInvoiceRepository invoiceRepository)
 {
     _pool = MemoryPool <byte> .Shared;
     _connectionHandler   = connectionHandler;
     _peerManagerProvider = peerManagerProvider;
     _walletService       = walletService;
     _network             = network;
     _eventAggregator     = eventAggregator;
     _logger            = logger;
     _invoiceRepository = invoiceRepository;
     _peerManager       = peerManagerProvider.TryGetPeerManager(network.CryptoCode);
 }