mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-25 00:33:20 +08:00
use EpochID check for disabling, add (missing) test file
This commit is contained in:
@@ -265,7 +265,10 @@ impl RewardSetProvider for OnChainRewardSetProvider {
|
||||
sortdb: &SortitionDB,
|
||||
block_id: &StacksBlockId,
|
||||
) -> Result<RewardSet, Error> {
|
||||
if current_burn_height > burnchain.pox_constants.v2_unlock_height as u64 {
|
||||
let cur_epoch = SortitionDB::get_stacks_epoch(sortdb.conn(), current_burn_height)?.expect(
|
||||
&format!("FATAL: no epoch for burn height {}", current_burn_height),
|
||||
);
|
||||
if cur_epoch.epoch_id >= StacksEpochId::Epoch22 {
|
||||
info!("PoX reward cycle defaulting to burn in Epoch 2.2");
|
||||
return Ok(RewardSet::empty());
|
||||
}
|
||||
@@ -300,10 +303,6 @@ impl RewardSetProvider for OnChainRewardSetProvider {
|
||||
"registered_addrs" => registered_addrs.len());
|
||||
}
|
||||
|
||||
let cur_epoch = SortitionDB::get_stacks_epoch(sortdb.conn(), current_burn_height)?.expect(
|
||||
&format!("FATAL: no epoch for burn height {}", current_burn_height),
|
||||
);
|
||||
|
||||
Ok(StacksChainState::make_reward_set(
|
||||
threshold,
|
||||
registered_addrs,
|
||||
|
||||
1087
testnet/stacks-node/src/tests/epoch_22.rs
Normal file
1087
testnet/stacks-node/src/tests/epoch_22.rs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user