@@ -23,41 +23,37 @@ def __init__(self, chain_type: ChainType):
2323 super ().__init__ (chain_type )
2424
2525
26- class BlockManagerOptions (KernelOpaquePtr ):
27- def __init__ (self , context : "Context" , blocksdir : str ):
28- blocksdir_bytes = blocksdir .encode ("utf-8" )
29- super ().__init__ (context , blocksdir_bytes , len (blocksdir_bytes ))
30-
31-
3226class ChainstateManagerOptions (KernelOpaquePtr ):
33- def __init__ (self , context : "Context" , datadir : str ):
27+ def __init__ (self , context : "Context" , datadir : str , blocks_dir : str ):
3428 datadir_bytes = datadir .encode ("utf-8" )
35- super ().__init__ (context , datadir_bytes , len (datadir_bytes ))
29+ blocksdir_bytes = blocks_dir .encode ("utf-8" )
30+ super ().__init__ (
31+ context ,
32+ datadir_bytes ,
33+ len (datadir_bytes ),
34+ blocksdir_bytes ,
35+ len (blocksdir_bytes ),
36+ )
37+
38+ def set_wipe_dbs (self , wipe_block_tree_db : bool , wipe_chainstate_db : bool ) -> bool :
39+ return k .kernel_chainstate_manager_options_set_wipe_dbs (
40+ self , wipe_block_tree_db , wipe_chainstate_db
41+ )
3642
3743 def set_worker_threads_num (self , worker_threads : int ):
3844 k .kernel_chainstate_manager_options_set_worker_threads_num (self , worker_threads )
3945
4046
41- class ChainstateLoadOptions (KernelOpaquePtr ):
42- def set_wipe_block_tree_db (self , value : bool ):
43- k .kernel_chainstate_load_options_set_wipe_block_tree_db (self , value )
44-
45- def set_wipe_chainstate_db (self , value : bool ):
46- k .kernel_chainstate_load_options_set_wipe_chainstate_db (self , value )
47-
48-
4947class ChainstateManager (KernelOpaquePtr ):
5048 _context : "Context" # Persisted to ensure context is not destroyed before ChainstateManager
5149
5250 def __init__ (
5351 self ,
5452 context : "Context" ,
5553 chain_man_opts : ChainstateManagerOptions ,
56- block_man_opts : BlockManagerOptions ,
57- chainstate_load_opts : ChainstateLoadOptions ,
5854 ):
5955 self ._context = context
60- super ().__init__ (context , chain_man_opts , block_man_opts , chainstate_load_opts )
56+ super ().__init__ (context , chain_man_opts )
6157
6258 def get_block_index_from_hash (self , hash : "BlockHash" ):
6359 return BlockIndex ._from_ptr (
0 commit comments