@@ -528,11 +528,6 @@ class CNode
528
528
*/
529
529
Network ConnectedThroughNetwork () const ;
530
530
531
- protected:
532
- mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY (cs_vSend);
533
- mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY (cs_vRecv);
534
-
535
- public:
536
531
// We selected peer as (compact blocks) high-bandwidth peer (BIP152)
537
532
std::atomic<bool > m_bip152_highbandwidth_to{false };
538
533
// Peer selected us as (compact blocks) high-bandwidth peer (BIP152)
@@ -604,43 +599,6 @@ class CNode
604
599
CNode (const CNode&) = delete ;
605
600
CNode& operator =(const CNode&) = delete ;
606
601
607
- private:
608
- const NodeId id;
609
- const uint64_t nLocalHostNonce;
610
- const ConnectionType m_conn_type;
611
- std::atomic<int > m_greatest_common_version{INIT_PROTO_VERSION};
612
-
613
- // ! Services offered to this peer.
614
- // !
615
- // ! This is supplied by the parent CConnman during peer connection
616
- // ! (CConnman::ConnectNode()) from its attribute of the same name.
617
- // !
618
- // ! This is const because there is no protocol defined for renegotiating
619
- // ! services initially offered to a peer. The set of local services we
620
- // ! offer should not change after initialization.
621
- // !
622
- // ! An interesting example of this is NODE_NETWORK and initial block
623
- // ! download: a node which starts up from scratch doesn't have any blocks
624
- // ! to serve, but still advertises NODE_NETWORK because it will eventually
625
- // ! fulfill this role after IBD completes. P2P code is written in such a
626
- // ! way that it can gracefully handle peers who don't make good on their
627
- // ! service advertisements.
628
- const ServiceFlags nLocalServices;
629
-
630
- std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
631
-
632
- mutable RecursiveMutex cs_addrName;
633
- std::string addrName GUARDED_BY (cs_addrName);
634
-
635
- // Our address, as reported by the peer
636
- CService addrLocal GUARDED_BY (cs_addrLocal);
637
- mutable RecursiveMutex cs_addrLocal;
638
-
639
- // ! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
640
- const bool m_inbound_onion{false };
641
-
642
- public:
643
-
644
602
NodeId GetId () const {
645
603
return id;
646
604
}
@@ -691,8 +649,6 @@ class CNode
691
649
nRefCount--;
692
650
}
693
651
694
-
695
-
696
652
void AddAddressKnown (const CAddress& _addr)
697
653
{
698
654
assert (m_addr_known);
@@ -724,7 +680,6 @@ class CNode
724
680
}
725
681
}
726
682
727
-
728
683
void AddKnownTx (const uint256& hash)
729
684
{
730
685
if (m_tx_relay != nullptr ) {
@@ -759,6 +714,44 @@ class CNode
759
714
760
715
/* * Whether this peer is an inbound onion, e.g. connected via our Tor onion service. */
761
716
bool IsInboundOnion () const { return m_inbound_onion; }
717
+
718
+ private:
719
+ const NodeId id;
720
+ const uint64_t nLocalHostNonce;
721
+ const ConnectionType m_conn_type;
722
+ std::atomic<int > m_greatest_common_version{INIT_PROTO_VERSION};
723
+
724
+ // ! Services offered to this peer.
725
+ // !
726
+ // ! This is supplied by the parent CConnman during peer connection
727
+ // ! (CConnman::ConnectNode()) from its attribute of the same name.
728
+ // !
729
+ // ! This is const because there is no protocol defined for renegotiating
730
+ // ! services initially offered to a peer. The set of local services we
731
+ // ! offer should not change after initialization.
732
+ // !
733
+ // ! An interesting example of this is NODE_NETWORK and initial block
734
+ // ! download: a node which starts up from scratch doesn't have any blocks
735
+ // ! to serve, but still advertises NODE_NETWORK because it will eventually
736
+ // ! fulfill this role after IBD completes. P2P code is written in such a
737
+ // ! way that it can gracefully handle peers who don't make good on their
738
+ // ! service advertisements.
739
+ const ServiceFlags nLocalServices;
740
+
741
+ std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
742
+
743
+ mutable RecursiveMutex cs_addrName;
744
+ std::string addrName GUARDED_BY (cs_addrName);
745
+
746
+ // Our address, as reported by the peer
747
+ CService addrLocal GUARDED_BY (cs_addrLocal);
748
+ mutable RecursiveMutex cs_addrLocal;
749
+
750
+ // ! Whether this peer is an inbound onion, e.g. connected via our Tor onion service.
751
+ const bool m_inbound_onion{false };
752
+
753
+ mapMsgCmdSize mapSendBytesPerMsgCmd GUARDED_BY (cs_vSend);
754
+ mapMsgCmdSize mapRecvBytesPerMsgCmd GUARDED_BY (cs_vRecv);
762
755
};
763
756
764
757
/* *
0 commit comments