Skip to content

Commit

Permalink
Added a 30% juice on coinbase reward for few hours after the fork
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Nov 6, 2024
1 parent 150efef commit dafa366
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions consensus/misc/rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ import (
)

func CalculateReward(parent *types.WorkObject, header *types.WorkObjectHeader) *big.Int {
var reward *big.Int
if header.PrimaryCoinbase().IsInQiLedgerScope() {
return CalculateQiReward(parent.WorkObjectHeader())
reward = new(big.Int).Set(CalculateQiReward(parent.WorkObjectHeader()))
} else {
return CalculateQuaiReward(parent)
reward = new(big.Int).Set(CalculateQuaiReward(parent))
}

if header.NumberU64() >= params.GoldenAgeForkNumberV2 && header.NumberU64() < params.GoldenAgeForkNumberV2+params.GoldenAgeForkGraceNumber {
reward = new(big.Int).Add(reward, new(big.Int).Div(reward, big.NewInt(70)))
}

return reward
}

// Calculate the amount of Quai that Qi can be converted to. Expect the current Header and the Qi amount in "qits", returns the quai amount in "its"
Expand Down

0 comments on commit dafa366

Please sign in to comment.