Skip to content

Commit c9e9fa4

Browse files
committed
feat(mining): reset witnessing age for validators with an accepted commit
1 parent 86943e6 commit c9e9fa4

File tree

1 file changed

+6
-0
lines changed
  • node/src/actors/chain_manager

1 file changed

+6
-0
lines changed

node/src/actors/chain_manager/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,12 @@ impl ChainManager {
10271027
if get_protocol_version(Some(block_epoch)) == ProtocolVersion::V2_0 {
10281028
let _ = stakes.reset_age(miner_pkh, Capability::Mining, current_epoch, 1);
10291029

1030+
for co_tx in &block.txns.commit_txns {
1031+
let commit_pkh = co_tx.body.proof.proof.pkh();
1032+
let _ =
1033+
stakes.reset_age(commit_pkh, Capability::Witnessing, current_epoch, 1);
1034+
}
1035+
10301036
let epoch_constants = self.epoch_constants.unwrap();
10311037
let utxo_diff =
10321038
UtxoDiff::new(&self.chain_state.unspent_outputs_pool, block_epoch);

0 commit comments

Comments
 (0)