Skip to content

Commit

Permalink
Merge branch 'feat/brioche-api' of https://github.com/wemixarchive/go…
Browse files Browse the repository at this point in the history
…-wemix into feat/brioche_devnet
  • Loading branch information
egonspace committed May 28, 2024
2 parents 179e493 + 68700e6 commit 6c66699
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,12 +743,15 @@ func (api *PublicWemixAPI) getBriocheBlockReward(blockNumber *big.Int) *big.Int
wemixInfo := *wemixInfoPtr
config := api.e.BlockChain().Config()

height := new(big.Int)
if blockNumber == nil {
blockNumber = api.e.BlockChain().CurrentHeader().Number
height.Set(api.e.BlockChain().CurrentHeader().Number)
} else {
height.Set(blockNumber)
}

if config.IsBrioche(blockNumber) {
return config.Brioche.GetBriocheBlockReward(wemixInfo["defaultBriocheBlockReward"].(*big.Int), blockNumber)
if config.IsBrioche(height) {
return config.Brioche.GetBriocheBlockReward(wemixInfo["defaultBriocheBlockReward"].(*big.Int), height)
} else {
return wemixInfo["blockReward"].(*big.Int)
}
Expand Down

0 comments on commit 6c66699

Please sign in to comment.