File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 22
22
P2PInterface ,
23
23
)
24
24
from test_framework .test_framework import BitcoinTestFramework
25
- from test_framework .util import (
26
- assert_equal ,
27
- )
25
+ from test_framework .util import assert_equal
28
26
29
27
VALID_DATA_LIMIT = MAX_PROTOCOL_MESSAGE_LENGTH - 5 # Account for the 5-byte length prefix
30
28
29
+
31
30
class msg_unrecognized :
32
31
"""Nonsensical message. Modeled after similar types in test_framework.messages."""
33
32
@@ -100,6 +99,8 @@ def test_checksum(self):
100
99
msg = msg [:cut_len ] + b'\xff ' * 4 + msg [cut_len + 4 :]
101
100
conn .send_raw_message (msg )
102
101
conn .sync_with_ping (timeout = 1 )
102
+ # Check that traffic is accounted for (24 bytes header + 2 bytes payload)
103
+ assert_equal (self .nodes [0 ].getpeerinfo ()[0 ]['bytesrecv_per_msg' ]['*other*' ], 26 )
103
104
self .nodes [0 ].disconnect_p2ps ()
104
105
105
106
def test_size (self ):
@@ -123,6 +124,8 @@ def test_msgtype(self):
123
124
msg = msg [:7 ] + b'\x00 ' + msg [7 + 1 :]
124
125
conn .send_raw_message (msg )
125
126
conn .sync_with_ping (timeout = 1 )
127
+ # Check that traffic is accounted for (24 bytes header + 2 bytes payload)
128
+ assert_equal (self .nodes [0 ].getpeerinfo ()[0 ]['bytesrecv_per_msg' ]['*other*' ], 26 )
126
129
self .nodes [0 ].disconnect_p2ps ()
127
130
128
131
def test_oversized_msg (self , msg , size ):
You can’t perform that action at this time.
0 commit comments