Exemple #1
0
        public NodeConnectionParameters()
        {
            ReuseBuffer = true;
            TemplateBehaviors.Add(new PingPongBehavior());
            Version             = null;
            IsRelay             = true;
            Services            = NodeServices.Nothing;
            ConnectCancellation = default;

            // Use max supported by MAC OSX Yosemite/Mavericks/Sierra (https://fasterdata.es.net/host-tuning/osx/)
            ReceiveBufferSize = 1048576;
            SendBufferSize    = 1048576;
            ////////////////////////

            UserAgent = VersionPayload.GetBitcoinNetUserAgent();
            PreferredTransactionOptions = TransactionOptions.All;
        }
Exemple #2
0
        public VersionPayload CreateVersion(IPEndPoint peer, Network network)
        {
            var version = new VersionPayload
            {
                Nonce           = Nonce ?? RandomUtils.GetUInt64(),
                UserAgent       = UserAgent,
                Version         = Version ?? network.MaxP2PVersion,
                Timestamp       = DateTimeOffset.UtcNow,
                AddressReceiver = peer,
                AddressFrom     = AddressFrom ??
                                  new IPEndPoint(IPAddress.Parse("0.0.0.0").MapToIPv6Ex(), network.DefaultPort),
                Relay    = IsRelay,
                Services = Services
            };

            return(version);
        }