|
|
|
@ -337,6 +337,23 @@ func (u *BlockUnlocker) handleBlock(block *rpc.GetBlockReply, candidate *storage |
|
|
|
reward.Add(reward, extraTxReward) |
|
|
|
reward.Add(reward, extraTxReward) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remove Burnt Fees, post London (Base Fee Per Gas * Gas Used)
|
|
|
|
|
|
|
|
baseFeePerGas := new(big.Int) |
|
|
|
|
|
|
|
bigBaseFeePerGas := util.DecodeValueHex(block.BaseFeePerGas) |
|
|
|
|
|
|
|
baseFeePerGas.SetString(bigBaseFeePerGas, 10) |
|
|
|
|
|
|
|
log.Println("baseFeePerGas: ", baseFeePerGas) |
|
|
|
|
|
|
|
log.Println("block.BaseFeePerGas: ", block.BaseFeePerGas) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//gasUsed := big.NewInt(int64(block.GasUsed))
|
|
|
|
|
|
|
|
gasUsed := new(big.Int) |
|
|
|
|
|
|
|
bigGasUsed := util.DecodeValueHex(block.GasUsed) |
|
|
|
|
|
|
|
gasUsed.SetString(bigGasUsed, 10) |
|
|
|
|
|
|
|
log.Println("gasUsed: ", gasUsed) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
burntFees := new(big.Int).Mul(baseFeePerGas, gasUsed) |
|
|
|
|
|
|
|
log.Println("BurntFees: ", burntFees) |
|
|
|
|
|
|
|
reward.Sub(reward, burntFees) |
|
|
|
|
|
|
|
|
|
|
|
candidate.Orphan = false |
|
|
|
candidate.Orphan = false |
|
|
|
candidate.Hash = block.Hash |
|
|
|
candidate.Hash = block.Hash |
|
|
|
candidate.Reward = reward |
|
|
|
candidate.Reward = reward |
|
|
|
|