diff options
author | Gleb Naumenko <naumenko.gs@gmail.com> | 2022-10-20 16:38:50 +0300 |
---|---|---|
committer | Gleb Naumenko <naumenko.gs@gmail.com> | 2022-11-10 09:21:57 +0200 |
commit | a60f729e293dcd11ca077b7c1c72b06119437faa (patch) | |
tree | e53aee4c414f624d61006dd2ae121a839c813ea4 /src/net_processing.cpp | |
parent | 6772cbf69cf075ac8dff3507bf9151400ed255b7 (diff) |
p2p: Drop roles from sendtxrcncl
This feature was currently redundant (although could have provided
more flexibility in the future), and already been causing confusion.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6aaacd5068..71bf48798d 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3279,11 +3279,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, // - we are not in -blocksonly mode. if (pfrom.m_relays_txs && !m_ignore_incoming_txs) { const uint64_t recon_salt = m_txreconciliation->PreRegisterPeer(pfrom.GetId()); - // We suggest our txreconciliation role (initiator/responder) based on - // the connection direction. m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::SENDTXRCNCL, - !pfrom.IsInboundConn(), - pfrom.IsInboundConn(), TXRECONCILIATION_VERSION, recon_salt)); } } @@ -3514,11 +3510,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, return; } - bool is_peer_initiator, is_peer_responder; - uint32_t peer_txreconcl_version; - uint64_t remote_salt; - vRecv >> is_peer_initiator >> is_peer_responder >> peer_txreconcl_version >> remote_salt; - if (m_txreconciliation->IsPeerRegistered(pfrom.GetId())) { // A peer is already registered, meaning we already received SENDTXRCNCL from them. LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "txreconciliation protocol violation from peer=%d (sendtxrcncl received from already registered peer); disconnecting\n", pfrom.GetId()); @@ -3526,10 +3517,12 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, return; } + uint32_t peer_txreconcl_version; + uint64_t remote_salt; + vRecv >> peer_txreconcl_version >> remote_salt; + const ReconciliationRegisterResult result = m_txreconciliation->RegisterPeer(pfrom.GetId(), pfrom.IsInboundConn(), - is_peer_initiator, is_peer_responder, - peer_txreconcl_version, - remote_salt); + peer_txreconcl_version, remote_salt); // If it's a protocol violation, disconnect. // If the peer was not found (but something unexpected happened) or it was registered, |