File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ impl StacksChainConfig {
110
110
}
111
111
112
112
const STACKS_CHAIN_CONFIG_DEFAULT_MAINNET : LazyCell < StacksChainConfig > =
113
- LazyCell :: new ( StacksChainConfig :: default_testnet ) ;
113
+ LazyCell :: new ( StacksChainConfig :: default_mainnet ) ;
114
114
115
115
/// Replay blocks from chainstate database
116
116
/// Terminates on error using `process::exit()`
Original file line number Diff line number Diff line change @@ -1471,7 +1471,31 @@ simulating a miner.
1471
1471
}
1472
1472
1473
1473
if argv[ 1 ] == "replay-naka-block" {
1474
- cli:: command_replay_block_nakamoto ( & argv[ 1 ..] , None ) ;
1474
+ let chain_config =
1475
+ if let Some ( network_flag_ix) = argv. iter ( ) . position ( |arg| arg == "--network" ) {
1476
+ let Some ( network_choice) = argv. get ( network_flag_ix + 1 ) else {
1477
+ eprintln ! ( "Must supply network choice after `--network` option" ) ;
1478
+ process:: exit ( 1 ) ;
1479
+ } ;
1480
+
1481
+ let network_config = match network_choice. as_str ( ) {
1482
+ "testnet" => cli:: StacksChainConfig :: default_testnet ( ) ,
1483
+ "mainnet" => cli:: StacksChainConfig :: default_mainnet ( ) ,
1484
+ other => {
1485
+ eprintln ! ( "Unknown network choice `{other}`" ) ;
1486
+ process:: exit ( 1 ) ;
1487
+ }
1488
+ } ;
1489
+
1490
+ argv. remove ( network_flag_ix + 1 ) ;
1491
+ argv. remove ( network_flag_ix) ;
1492
+
1493
+ Some ( network_config)
1494
+ } else {
1495
+ None
1496
+ } ;
1497
+
1498
+ cli:: command_replay_block_nakamoto ( & argv[ 1 ..] , chain_config. as_ref ( ) ) ;
1475
1499
process:: exit ( 0 ) ;
1476
1500
}
1477
1501
You can’t perform that action at this time.
0 commit comments