tests: Call reservebalance to trigger WakeThreadStakeMiner
Node 0 needs a short advantage to stake the first few blocks to avoid prevout-not-found errors.
This commit is contained in:
		
							parent
							
								
									47c1237f6d
								
							
						
					
					
						commit
						7bc411eb98
					
				@ -305,6 +305,8 @@ class Test(unittest.TestCase):
 | 
			
		||||
                rpc('rescanblockchain')
 | 
			
		||||
            else:
 | 
			
		||||
                rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']])
 | 
			
		||||
            rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}])
 | 
			
		||||
            rpc('reservebalance', [False])
 | 
			
		||||
 | 
			
		||||
            basicswap_dir = os.path.join(os.path.join(cfg.TEST_DATADIRS, str(i)), 'basicswap')
 | 
			
		||||
            settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME)
 | 
			
		||||
 | 
			
		||||
@ -221,6 +221,7 @@ class Test(unittest.TestCase):
 | 
			
		||||
                    rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']])
 | 
			
		||||
                # Lower output split threshold for more stakeable outputs
 | 
			
		||||
                rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}])
 | 
			
		||||
                rpc('reservebalance', [False])
 | 
			
		||||
 | 
			
		||||
            for i in range(NUM_BTC_NODES):
 | 
			
		||||
                data_dir = prepareDataDir(TEST_DIR, i, 'bitcoin.conf', 'btc_', base_p2p_port=BTC_BASE_PORT, base_rpc_port=BTC_BASE_RPC_PORT)
 | 
			
		||||
 | 
			
		||||
@ -297,6 +297,8 @@ class Test(unittest.TestCase):
 | 
			
		||||
                rpc('rescanblockchain')
 | 
			
		||||
            else:
 | 
			
		||||
                rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']])
 | 
			
		||||
            rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}])
 | 
			
		||||
            rpc('reservebalance', [False])
 | 
			
		||||
 | 
			
		||||
            basicswap_dir = os.path.join(os.path.join(cfg.TEST_DATADIRS, str(i)), 'basicswap')
 | 
			
		||||
            settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME)
 | 
			
		||||
 | 
			
		||||
@ -317,6 +317,8 @@ class Test(unittest.TestCase):
 | 
			
		||||
                rpc('rescanblockchain')
 | 
			
		||||
            else:
 | 
			
		||||
                rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']])
 | 
			
		||||
            rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}])
 | 
			
		||||
            rpc('reservebalance', [False])
 | 
			
		||||
 | 
			
		||||
            basicswap_dir = os.path.join(os.path.join(cfg.TEST_DATADIRS, str(i)), 'basicswap')
 | 
			
		||||
            settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME)
 | 
			
		||||
 | 
			
		||||
@ -395,6 +395,7 @@ class BaseTest(unittest.TestCase):
 | 
			
		||||
                        rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']])
 | 
			
		||||
                    # Lower output split threshold for more stakeable outputs
 | 
			
		||||
                    rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}])
 | 
			
		||||
                    rpc('reservebalance', [False])
 | 
			
		||||
 | 
			
		||||
            for i in range(NUM_BTC_NODES):
 | 
			
		||||
                if not cls.restore_instance:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user