Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_leak.py
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | class CLazyNode(P2PInterface): | ||||
def on_blocktxn(self, message): self.bad_message(message) | def on_blocktxn(self, message): self.bad_message(message) | ||||
# Node that never sends a version. We'll use this to send a bunch of messages | # Node that never sends a version. We'll use this to send a bunch of messages | ||||
# anyway, and eventually get disconnected. | # anyway, and eventually get disconnected. | ||||
class CNodeNoVersionBan(CLazyNode): | class CNodeNoVersionBan(CLazyNode): | ||||
# send a bunch of veracks without sending a message. This should get us disconnected. | # send a bunch of veracks without sending a message. This should get us disconnected. | ||||
# NOTE: implementation-specific check here. Remove if bitcoind ban behavior changes | # NOTE: implementation-specific check here. Remove if bitcoind ban | ||||
# behavior changes | |||||
def on_open(self): | def on_open(self): | ||||
super().on_open() | super().on_open() | ||||
for i in range(banscore): | for i in range(banscore): | ||||
self.send_message(msg_verack()) | self.send_message(msg_verack()) | ||||
def on_reject(self, message): pass | def on_reject(self, message): pass | ||||
# Node that never sends a version. This one just sits idle and hopes to receive | # Node that never sends a version. This one just sits idle and hopes to receive | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |