| 1132 | } // namespace |
| 1133 | |
| 1134 | void PeerManagerImpl::PushNodeVersion(CNode& pnode) |
| 1135 | { |
| 1136 | // Note that pnode->GetLocalServices() is a reflection of the local |
| 1137 | // services we were offering when the CNode object was created for this |
| 1138 | // peer. |
| 1139 | uint64_t my_services{pnode.GetLocalServices()}; |
| 1140 | const int64_t nTime{count_seconds(GetTime<std::chrono::seconds>())}; |
| 1141 | uint64_t nonce = pnode.GetLocalNonce(); |
| 1142 | const int nNodeStartingHeight{m_best_height}; |
| 1143 | NodeId nodeid = pnode.GetId(); |
| 1144 | CAddress addr = pnode.addr; |
| 1145 | |
| 1146 | CService addr_you = addr.IsRoutable() && !IsProxy(addr) && addr.IsAddrV1Compatible() ? addr : CService(); |
| 1147 | uint64_t your_services{addr.nServices}; |
| 1148 | |
| 1149 | const bool tx_relay = !m_ignore_incoming_txs && pnode.m_tx_relay != nullptr && !pnode.IsFeelerConn(); |
| 1150 | m_connman.PushMessage(&pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, my_services, nTime, |
| 1151 | your_services, addr_you, // Together the pre-version-31402 serialization of CAddress "addrYou" (without nTime) |
| 1152 | my_services, CService(), // Together the pre-version-31402 serialization of CAddress "addrMe" (without nTime) |
| 1153 | nonce, strSubVersion, nNodeStartingHeight, tx_relay)); |
| 1154 | |
| 1155 | if (fLogIPs) { |
| 1156 | LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, them=%s, txrelay=%d, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addr_you.ToString(), tx_relay, nodeid); |
| 1157 | } else { |
| 1158 | LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, txrelay=%d, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, tx_relay, nodeid); |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | void PeerManagerImpl::AddTxAnnouncement(const CNode& node, const GenTxid& gtxid, std::chrono::microseconds current_time) |
| 1163 | { |
nothing calls this directly
no test coverage detected