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 4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""Test node disconnect and ban behavior"""
6
6
import time
7
+ from pathlib import Path
7
8
8
9
from test_framework .test_framework import BitcoinTestFramework
9
10
from test_framework .util import (
@@ -36,6 +37,17 @@ def run_test(self):
36
37
self .log .info ("clearbanned: successfully clear ban list" )
37
38
self .nodes [1 ].clearbanned ()
38
39
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
+
39
51
self .nodes [1 ].setban ("127.0.0.0/24" , "add" )
40
52
41
53
self .log .info ("setban: fail to ban an already banned subnet" )
You can’t perform that action at this time.
0 commit comments