Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
coinbase 0
Browse files Browse the repository at this point in the history
  • Loading branch information
yzb@example.cn committed Dec 22, 2023
1 parent bbcba3d commit bfb64cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions protocol/state/reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import (
)

func (c *Checkpoint) validatorReward() uint64 {
if c.Height > 12283120 {
return 0
}
return c.validatorReward2()
}

func (c *Checkpoint) validatorReward2() uint64 {
if pledgeRate := c.pledgeRate(); pledgeRate <= consensus.RewardThreshold {
return uint64((pledgeRate + consensus.RewardThreshold) * float64(consensus.BlockReward))
}
Expand Down
1 change: 1 addition & 0 deletions protocol/validation/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func checkCoinbaseAmount(b *types.Block, checkpoint *state.Checkpoint) error {
}

func checkoutRewardCoinbase(tx *types.Tx, checkpoint *state.Checkpoint) error {
return nil
outputMap := map[string]uint64{}
for i, output := range tx.Outputs {
if i == 0 && output.Amount == 0 {
Expand Down

0 comments on commit bfb64cd

Please sign in to comment.