From bfb64cdc84d6406997a7f86e21c443c3b981c54f Mon Sep 17 00:00:00 2001 From: "yzb@example.cn" Date: Fri, 22 Dec 2023 17:54:49 +0800 Subject: [PATCH] coinbase 0 --- protocol/state/reward.go | 7 +++++++ protocol/validation/block.go | 1 + 2 files changed, 8 insertions(+) diff --git a/protocol/state/reward.go b/protocol/state/reward.go index 76f98a8ff..78cae1e6c 100644 --- a/protocol/state/reward.go +++ b/protocol/state/reward.go @@ -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)) } diff --git a/protocol/validation/block.go b/protocol/validation/block.go index ddd7d45fc..3adb5834e 100644 --- a/protocol/validation/block.go +++ b/protocol/validation/block.go @@ -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 {