@@ -54,8 +54,6 @@ static const int TIMEOUT_INTERVAL = 20 * 60;
54
54
static constexpr auto FEELER_INTERVAL = 2min;
55
55
/* * Run the extra block-relay-only connection loop once every 5 minutes. **/
56
56
static constexpr auto EXTRA_BLOCK_RELAY_ONLY_PEER_INTERVAL = 5min;
57
- /* * The maximum number of addresses from our addrman to return in response to a getaddr message. */
58
- static constexpr size_t MAX_ADDR_TO_SEND = 1000 ;
59
57
/* * Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable). */
60
58
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 4 * 1000 * 1000 ;
61
59
/* * Maximum length of the user agent string in `version` message */
@@ -447,17 +445,11 @@ class CNode
447
445
}
448
446
bool fClient {false }; // set by version message
449
447
bool m_limited_node{false }; // after BIP159, set by version message
450
- /* *
451
- * Whether the peer has signaled support for receiving ADDRv2 (BIP155)
452
- * messages, implying a preference to receive ADDRv2 instead of ADDR ones.
453
- */
454
- std::atomic_bool m_wants_addrv2{false };
455
448
/* * fSuccessfullyConnected is set to true on receiving VERACK from the peer. */
456
449
std::atomic_bool fSuccessfullyConnected {false };
457
450
// Setting fDisconnect to true will cause the node to be disconnected the
458
451
// next time DisconnectNodes() runs
459
452
std::atomic_bool fDisconnect {false };
460
- bool fSentAddr {false };
461
453
CSemaphoreGrant grantOutbound;
462
454
std::atomic<int > nRefCount{0 };
463
455
@@ -504,15 +496,6 @@ class CNode
504
496
return m_conn_type == ConnectionType::INBOUND;
505
497
}
506
498
507
- /* Whether we send addr messages over this connection */
508
- bool RelayAddrsWithConn () const
509
- {
510
- // Don't relay addr messages to peers that we connect to as block-relay-only
511
- // peers (to prevent adversaries from inferring these links from addr
512
- // traffic).
513
- return m_conn_type != ConnectionType::BLOCK_RELAY;
514
- }
515
-
516
499
bool ExpectServicesFromConn () const {
517
500
switch (m_conn_type) {
518
501
case ConnectionType::INBOUND:
@@ -545,14 +528,6 @@ class CNode
545
528
// Peer selected us as (compact blocks) high-bandwidth peer (BIP152)
546
529
std::atomic<bool > m_bip152_highbandwidth_from{false };
547
530
548
- // flood relay
549
- std::vector<CAddress> vAddrToSend;
550
- std::unique_ptr<CRollingBloomFilter> m_addr_known{nullptr };
551
- bool fGetAddr {false };
552
- Mutex m_addr_send_times_mutex;
553
- std::chrono::microseconds m_next_addr_send GUARDED_BY (m_addr_send_times_mutex){0 };
554
- std::chrono::microseconds m_next_local_addr_send GUARDED_BY (m_addr_send_times_mutex){0 };
555
-
556
531
struct TxRelay {
557
532
mutable RecursiveMutex cs_filter;
558
533
// We use fRelayTxes for two purposes -
@@ -657,37 +632,6 @@ class CNode
657
632
nRefCount--;
658
633
}
659
634
660
- void AddAddressKnown (const CAddress& _addr)
661
- {
662
- assert (m_addr_known);
663
- m_addr_known->insert (_addr.GetKey ());
664
- }
665
-
666
- /* *
667
- * Whether the peer supports the address. For example, a peer that does not
668
- * implement BIP155 cannot receive Tor v3 addresses because it requires
669
- * ADDRv2 (BIP155) encoding.
670
- */
671
- bool IsAddrCompatible (const CAddress& addr) const
672
- {
673
- return m_wants_addrv2 || addr.IsAddrV1Compatible ();
674
- }
675
-
676
- void PushAddress (const CAddress& _addr, FastRandomContext &insecure_rand)
677
- {
678
- // Known checking here is only to save space from duplicates.
679
- // SendMessages will filter it again for knowns that were added
680
- // after addresses were pushed.
681
- assert (m_addr_known);
682
- if (_addr.IsValid () && !m_addr_known->contains (_addr.GetKey ()) && IsAddrCompatible (_addr)) {
683
- if (vAddrToSend.size () >= MAX_ADDR_TO_SEND) {
684
- vAddrToSend[insecure_rand.randrange (vAddrToSend.size ())] = _addr;
685
- } else {
686
- vAddrToSend.push_back (_addr);
687
- }
688
- }
689
- }
690
-
691
635
void AddKnownTx (const uint256& hash)
692
636
{
693
637
if (m_tx_relay != nullptr ) {
0 commit comments