Skip to content

Commit 8e097ef

Browse files
committed
fix: don't use standard epoch indices in assert_valid_epoch_settings
The list of epochs passed in here is not complete, so we cannot use the standard epoch indices for it.
1 parent 26d7aaf commit 8e097ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testnet/stacks-node/src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ impl Config {
608608
let _ = StacksEpoch::validate_epochs(epochs);
609609

610610
// sanity check: v1_unlock_height must happen after pox-2 instantiation
611-
let epoch21_index = StacksEpochId::Epoch21.index();
611+
let epoch21_index = StacksEpoch::find_epoch_by_id(&epochs, StacksEpochId::Epoch21)
612+
.expect("FATAL: no epoch 2.1 defined");
612613
let epoch21 = &epochs[epoch21_index];
613614
let v1_unlock_height = burnchain.pox_constants.v1_unlock_height as u64;
614615

0 commit comments

Comments
 (0)