1414# Service flags
1515NODE_COMPACT_FILTERS = (1 << 6 )
1616
17+ # Constants
18+ BASIC_FILTER_INDEX = 'basic filter index'
19+
1720
1821class MasternodeParamsTest (BitcoinTestFramework ):
1922 def set_test_params (self ):
@@ -30,7 +33,7 @@ def run_test(self):
3033
3134 # Regular node should not have blockfilterindex enabled
3235 index_info = node0 .getindexinfo ()
33- assert 'basic filter index' not in index_info
36+ assert BASIC_FILTER_INDEX not in index_info
3437
3538 self .log .info ("Test that masternode has blockfilters auto-enabled" )
3639 # Generate a valid BLS key for testing
@@ -68,16 +71,22 @@ def run_test(self):
6871
6972 # Should not have blockfilterindex
7073 index_info = node1 .getindexinfo ()
71- assert 'basic filter index' not in index_info
74+ assert BASIC_FILTER_INDEX not in index_info
7275
7376 self .log .info ("Test that masternode parameter interaction is logged" )
74- # Check debug log for parameter interaction messages
75- with open (node1 .debug_log_path , 'r' , encoding = 'utf-8' ) as f :
76- log_content = f .read ()
77- assert "parameter interaction: -masternodeblsprivkey set -> setting -disablewallet=1" in log_content
78- # Note: The peerblockfilters and blockfilterindex messages won't be in the log
79- # when explicitly disabled, only when auto-enabled
77+ # Stop the node first so we can check the startup logs
78+ self .stop_node (1 )
79+
80+ # Check debug log for parameter interaction messages during startup
81+ with self .nodes [1 ].assert_debug_log (["parameter interaction: -masternodeblsprivkey set -> setting -disablewallet=1" ]):
82+ self .start_node (1 , extra_args = [
83+ f"-masternodeblsprivkey={ bls_key } " ,
84+ "-peerblockfilters=0" ,
85+ "-blockfilterindex=0"
86+ ])
87+ # Note: The peerblockfilters and blockfilterindex messages won't be in the log
88+ # when explicitly disabled, only when auto-enabled
8089
8190
8291if __name__ == '__main__' :
83- MasternodeParamsTest ().main ()
92+ MasternodeParamsTest ().main ()
0 commit comments