@@ -44,6 +44,12 @@ pub struct Config {
4444 /// Tx cache size in megabytes
4545 pub tx_cache_size : usize ,
4646
47+ /// Enable compaction during initial sync
48+ ///
49+ /// By default compaction is off until initial sync is finished for performance reasons,
50+ /// however, this requires much more disk space.
51+ pub initial_sync_compaction : bool ,
52+
4753 #[ cfg( feature = "liquid" ) ]
4854 pub parent_network : BNetwork ,
4955 #[ cfg( feature = "liquid" ) ]
@@ -199,6 +205,10 @@ impl Config {
199205 . long ( "tx-cache-size" )
200206 . help ( "The amount of MB for a in-memory cache for transactions." )
201207 . default_value ( "1000" )
208+ ) . arg (
209+ Arg :: with_name ( "initial_sync_compaction" )
210+ . long ( "initial-sync-compaction" )
211+ . help ( "Perform compaction during initial sync (slower but less disk space required)" )
202212 ) ;
203213
204214 #[ cfg( unix) ]
@@ -412,6 +422,7 @@ impl Config {
412422 cors : m. value_of ( "cors" ) . map ( |s| s. to_string ( ) ) ,
413423 precache_scripts : m. value_of ( "precache_scripts" ) . map ( |s| s. to_string ( ) ) ,
414424 tx_cache_size : value_t_or_exit ! ( m, "tx_cache_size" , usize ) ,
425+ initial_sync_compaction : m. is_present ( "initial_sync_compaction" ) ,
415426
416427 #[ cfg( feature = "liquid" ) ]
417428 parent_network,
0 commit comments