File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 44# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55"""Test node disconnect and ban behavior"""
66import time
7+ from pathlib import Path
78
89from test_framework .test_framework import BitcoinTestFramework
910from test_framework .util import (
@@ -36,6 +37,17 @@ def run_test(self):
3637 self .log .info ("clearbanned: successfully clear ban list" )
3738 self .nodes [1 ].clearbanned ()
3839 assert_equal (len (self .nodes [1 ].listbanned ()), 0 )
40+
41+ self .log .info ('Test banlist database recreation' )
42+ self .stop_node (1 )
43+ target_file = self .nodes [1 ].chain_path / "banlist.json"
44+ Path .unlink (target_file )
45+ with self .nodes [1 ].assert_debug_log (["Recreating the banlist database" ]):
46+ self .start_node (1 )
47+
48+ assert Path .exists (target_file )
49+ assert_equal (self .nodes [1 ].listbanned (), [])
50+
3951 self .nodes [1 ].setban ("127.0.0.0/24" , "add" )
4052
4153 self .log .info ("setban: fail to ban an already banned subnet" )
You can’t perform that action at this time.
0 commit comments