File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""Tests NODE_COMPACT_FILTERS (BIP 157/158).
6
6
7
- Tests that a node configured with -blockfilterindex and -peerblockfilters can serve
8
- cfilters, cfheaders and cfcheckpts.
7
+ Tests that a node configured with -blockfilterindex and -peerblockfilters signals
8
+ NODE_COMPACT_FILTERS and can serve cfilters, cfheaders and cfcheckpts.
9
9
"""
10
10
11
11
from test_framework .messages import (
12
12
FILTER_TYPE_BASIC ,
13
+ NODE_COMPACT_FILTERS ,
13
14
hash256 ,
14
15
msg_getcfcheckpt ,
15
16
msg_getcfheaders ,
@@ -70,6 +71,14 @@ def run_test(self):
70
71
self .nodes [1 ].generate (1001 )
71
72
wait_until (lambda : self .nodes [1 ].getblockcount () == 2000 )
72
73
74
+ # Check that nodes have signalled NODE_COMPACT_FILTERS correctly.
75
+ assert node0 .nServices & NODE_COMPACT_FILTERS != 0
76
+ assert node1 .nServices & NODE_COMPACT_FILTERS == 0
77
+
78
+ # Check that the localservices is as expected.
79
+ assert int (self .nodes [0 ].getnetworkinfo ()['localservices' ], 16 ) & NODE_COMPACT_FILTERS != 0
80
+ assert int (self .nodes [1 ].getnetworkinfo ()['localservices' ], 16 ) & NODE_COMPACT_FILTERS == 0
81
+
73
82
self .log .info ("get cfcheckpt on chain to be re-orged out." )
74
83
request = msg_getcfcheckpt (
75
84
filter_type = FILTER_TYPE_BASIC ,
Original file line number Diff line number Diff line change 49
49
NODE_GETUTXO = (1 << 1 )
50
50
NODE_BLOOM = (1 << 2 )
51
51
NODE_WITNESS = (1 << 3 )
52
+ NODE_COMPACT_FILTERS = (1 << 6 )
52
53
NODE_NETWORK_LIMITED = (1 << 10 )
53
54
54
55
MSG_TX = 1
You can’t perform that action at this time.
0 commit comments