File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import time
9
9
10
- from test_framework .messages import msg_pong
10
+ from test_framework .messages import (
11
+ msg_pong ,
12
+ msg_generic ,
13
+ )
11
14
from test_framework .p2p import P2PInterface
12
15
from test_framework .test_framework import BitcoinTestFramework
13
16
from test_framework .util import (
20
23
TIMEOUT_INTERVAL = 20 * 60
21
24
22
25
23
- class msg_pong_corrupt (msg_pong ):
24
- def serialize (self ):
25
- return b""
26
-
27
-
28
26
class NodeNoPong (P2PInterface ):
29
27
def on_ping (self , message ):
30
28
pass
@@ -60,7 +58,7 @@ def run_test(self):
60
58
61
59
self .log .info ('Reply without nonce cancels ping' )
62
60
with self .nodes [0 ].assert_debug_log (['pong peer=0: Short payload' ]):
63
- no_pong_node .send_and_ping (msg_pong_corrupt ( ))
61
+ no_pong_node .send_and_ping (msg_generic ( b"pong" , b"" ))
64
62
self .check_peer_info (pingtime = None , minping = None , pingwait = None )
65
63
66
64
self .log .info ('Reply without ping' )
Original file line number Diff line number Diff line change @@ -1374,8 +1374,8 @@ def __repr__(self):
1374
1374
return "msg_block(block=%s)" % (repr (self .block ))
1375
1375
1376
1376
1377
- # for cases where a user needs tighter control over what is sent over the wire
1378
- # note that the user must supply the name of the msgtype, and the data
1377
+ # Generic type to control the raw bytes sent over the wire.
1378
+ # The msgtype and the data must be provided.
1379
1379
class msg_generic :
1380
1380
__slots__ = ("msgtype" , "data" )
1381
1381
You can’t perform that action at this time.
0 commit comments