Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14362724
D11020.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D11020.diff
View Options
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3728,6 +3728,13 @@
State(pfrom.GetId())
->m_recently_announced_proofs.insert(localProof->getId());
}
+
+ // Send getavaaddr to our avalanche outbound connections
+ if (pfrom.IsAvalancheOutboundConnection()) {
+ m_connman.PushMessage(&pfrom,
+ msgMaker.Make(NetMsgType::GETAVAADDR));
+ peer->m_addr_token_bucket += GetMaxAddrToSend();
+ }
}
pfrom.fSuccessfullyConnected = true;
diff --git a/test/functional/abc_p2p_getavaaddr.py b/test/functional/abc_p2p_getavaaddr.py
--- a/test/functional/abc_p2p_getavaaddr.py
+++ b/test/functional/abc_p2p_getavaaddr.py
@@ -7,6 +7,8 @@
from test_framework.avatools import AvaP2PInterface, gen_proof
from test_framework.messages import (
+ NODE_AVALANCHE,
+ NODE_NETWORK,
AvalancheVote,
AvalancheVoteError,
msg_getavaaddr,
@@ -194,6 +196,25 @@
# Check all the addresses belong to responding peer
assert all([address in responding_addresses for address in addresses])
+ def getavaaddr_outbound_test(self):
+ self.log.info(
+ "Check we send a getavaaddr message to our avalanche outbound peers")
+ node = self.nodes[0]
+
+ avapeers = []
+ for i in range(16):
+ avapeer = P2PInterface()
+ node.add_outbound_p2p_connection(
+ avapeer,
+ p2p_idx=i,
+ connection_type="avalanche",
+ services=NODE_NETWORK | NODE_AVALANCHE,
+ )
+ avapeers.append(avapeer)
+
+ self.wait_until(
+ lambda: all([p.last_message.get("getavaaddr") for p in avapeers]))
+
def run_test(self):
self.getavaaddr_interval_test()
@@ -202,6 +223,8 @@
# Limited by the number of good nodes
self.address_test(maxaddrtosend=100, num_proof=2, num_avanode=8)
+ self.getavaaddr_outbound_test()
+
if __name__ == '__main__':
AvaAddrTest().main()
diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py
--- a/test/functional/test_framework/p2p.py
+++ b/test/functional/test_framework/p2p.py
@@ -51,6 +51,7 @@
msg_filterclear,
msg_filterload,
msg_getaddr,
+ msg_getavaaddr,
msg_getblocks,
msg_getblocktxn,
msg_getdata,
@@ -106,6 +107,7 @@
b"filterclear": msg_filterclear,
b"filterload": msg_filterload,
b"getaddr": msg_getaddr,
+ b"getavaaddr": msg_getavaaddr,
b"getblocks": msg_getblocks,
b"getblocktxn": msg_getblocktxn,
b"getdata": msg_getdata,
@@ -456,6 +458,8 @@
def on_getaddr(self, message): pass
+ def on_getavaaddr(self, message): pass
+
def on_getblocks(self, message): pass
def on_getblocktxn(self, message): pass
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 12, 01:42 (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5777047
Default Alt Text
D11020.diff (2 KB)
Attached To
D11020: [avalanche] Send a getavaaddr message to our avalanche outbound peers
Event Timeline
Log In to Comment