mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
net: Set relay in version msg to peers with relay permission
This commit is contained in:
parent
914c00074b
commit
dddd1acf58
3 changed files with 4 additions and 1 deletions
|
|
@ -1383,7 +1383,7 @@ void PeerManagerImpl::PushNodeVersion(CNode& pnode, const Peer& peer)
|
|||
CService addr_you = addr.IsRoutable() && !IsProxy(addr) && addr.IsAddrV1Compatible() ? addr : CService();
|
||||
uint64_t your_services{addr.nServices};
|
||||
|
||||
const bool tx_relay = !m_ignore_incoming_txs && !pnode.IsBlockOnlyConn() && !pnode.IsFeelerConn();
|
||||
const bool tx_relay{!RejectIncomingTxs(pnode)};
|
||||
m_connman.PushMessage(&pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, my_services, nTime,
|
||||
your_services, addr_you, // Together the pre-version-31402 serialization of CAddress "addrYou" (without nTime)
|
||||
my_services, CService(), // Together the pre-version-31402 serialization of CAddress "addrMe" (without nTime)
|
||||
|
|
@ -5224,6 +5224,7 @@ bool PeerManagerImpl::RejectIncomingTxs(const CNode& peer) const
|
|||
{
|
||||
// block-relay-only peers may never send txs to us
|
||||
if (peer.IsBlockOnlyConn()) return true;
|
||||
if (peer.IsFeelerConn()) return true;
|
||||
// In -blocksonly mode, peers need the 'relay' permission to send txs to us
|
||||
if (m_ignore_incoming_txs && !peer.HasPermission(NetPermissionFlags::Relay)) return true;
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue