Exemplo n.º 1
0
 public FeeEstimatorDelegatesHolder(IFeeEstimator feeEstimator)
 {
     _feeEstimator           = feeEstimator ?? throw new ArgumentNullException(nameof(feeEstimator));
     _getEstSatPer1000Weight = feeEstimator.GetEstSatPer1000Weight;
     _handle   = GCHandle.Alloc(_getEstSatPer1000Weight);
     _disposed = false;
 }
 public ManyChannelMonitorReadArgs(IChainWatchInterface chainWatchInterface, IBroadcaster broadcaster,
                                   ILogger logger, IFeeEstimator feeEstimator, NBitcoin.Network n)
 {
     _chainWatchInterface = chainWatchInterface ?? throw new ArgumentNullException(nameof(chainWatchInterface));
     _broadcaster         = broadcaster ?? throw new ArgumentNullException(nameof(broadcaster));
     _logger       = logger ?? throw new ArgumentNullException(nameof(logger));
     _feeEstimator = feeEstimator ?? throw new ArgumentNullException(nameof(feeEstimator));
     _n            = n ?? throw new ArgumentNullException(nameof(n));
 }
 public ChannelManagerReadArgs(IKeysInterface keysInterface, IBroadcaster broadcaster, IFeeEstimator feeEstimator, ILogger logger, IChainWatchInterface chainWatchInterface, NBitcoin.Network n, ManyChannelMonitor manyChannelMonitor)
 {
     _keysInterface       = keysInterface ?? throw new ArgumentNullException(nameof(keysInterface));
     _broadcaster         = broadcaster ?? throw new ArgumentNullException(nameof(broadcaster));
     _feeEstimator        = feeEstimator ?? throw new ArgumentNullException(nameof(feeEstimator));
     _logger              = logger ?? throw new ArgumentNullException(nameof(logger));
     _chainWatchInterface = chainWatchInterface ?? throw new ArgumentNullException(nameof(chainWatchInterface));
     _n = n;
     ManyChannelMonitor = manyChannelMonitor ?? throw new ArgumentNullException(nameof(manyChannelMonitor));
 }
Exemplo n.º 4
0
 public static ManyChannelMonitor Create(
     NBitcoin.Network network,
     IChainWatchInterface chainWatchInterface,
     IBroadcaster broadcaster,
     ILogger logger,
     IFeeEstimator feeEstimator)
 {
     return(Create(new ChainWatchInterfaceDelegatesHolder(chainWatchInterface),
                   new BroadcasterDelegatesHolder(broadcaster, network), new LoggerDelegatesHolder(logger),
                   new FeeEstimatorDelegatesHolder(feeEstimator)));
 }
        public TestPeerManagerProvider(IBroadcaster broadcaster, IFeeEstimator feeEstimator, IChainWatchInterface chainWatchInterface, IOptions <Config> config, ILoggerFactory loggerFactory, IKeysRepository keysRepository)
        {
            _broadcaster         = broadcaster;
            _feeEstimator        = feeEstimator;
            _chainWatchInterface = chainWatchInterface;
            var seed          = new byte[32];
            var n             = NBitcoin.Network.RegTest;
            var conf          = config.Value.RustLightningConfig;
            var logger        = new NativeLogger(loggerFactory.CreateLogger <NativeLogger>());
            var keysInterface = new KeysManager(seed, DateTime.UnixEpoch);

            _peerManager =
                PeerManager.Create(seed.AsSpan(), n, conf, chainWatchInterface, keysInterface, broadcaster, logger, feeEstimator, 100);
        }
Exemplo n.º 6
0
        public static ChannelManager Create(
            NBitcoin.Network nbitcoinNetwork,
            IUserConfigProvider config,
            IChainWatchInterface chainWatchInterface,
            IKeysInterface keysInterface,
            ILogger logger,
            IBroadcaster broadcaster,
            IFeeEstimator feeEstimator,
            ulong currentBlockHeight
            )
        {
            var c = config.GetUserConfig();

            return(Create(nbitcoinNetwork, in c, chainWatchInterface, keysInterface, logger, broadcaster, feeEstimator, currentBlockHeight));
        }
Exemplo n.º 7
0
        public static PeerManager Create(
            Span <byte> seed,
            NBitcoin.Network nbitcoinNetwork,
            IUserConfigProvider config,
            IChainWatchInterface chainWatchInterface,
            IKeysInterface keysInterface,
            IBroadcaster broadcaster,
            ILogger logger,
            IFeeEstimator feeEstimator,
            uint currentBlockHeight,
            int tickIntervalMSec = 30000
            )
        {
            var c = config.GetUserConfig();

            return(Create(seed, nbitcoinNetwork, in c, chainWatchInterface, keysInterface, broadcaster, logger, feeEstimator, currentBlockHeight, tickIntervalMSec));
        }
Exemplo n.º 8
0
 public FeeEstimatorDelegatesHolder(IFeeEstimator feeEstimator)
 {
     _feeEstimator           = feeEstimator ?? throw new ArgumentNullException(nameof(feeEstimator));
     _getEstSatPer1000Weight = confirmationTarget => _feeEstimator.GetEstSatPer1000Weight(confirmationTarget);
 }