mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
Treasury percents
This commit is contained in:
parent
78ec7daed7
commit
90ad76258f
2 changed files with 4 additions and 12 deletions
|
|
@ -42,6 +42,8 @@ var (
|
|||
ByzantiumBlockReward *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium
|
||||
maxUncles = 2 // Maximum number of uncles allowed in a single block
|
||||
allowedFutureBlockTime = 15 * time.Second
|
||||
treasuryDevFunds *big.Int = big.NewInt(20)
|
||||
stakeFunds *big.Int = big.NewInt(10)
|
||||
)
|
||||
|
||||
// Various error messages to mark blocks invalid. These should be private to
|
||||
|
|
@ -607,10 +609,9 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
|
|||
blockReward = ByzantiumBlockReward
|
||||
}
|
||||
|
||||
treasuryPercent := getTreasuryPercent(header)
|
||||
reward := new(big.Int).Set(blockReward)
|
||||
treasuryReward := new(big.Int)
|
||||
treasuryReward.Mul(reward, big.NewInt(treasuryPercent))
|
||||
treasuryReward.Mul(reward, treasuryDevFunds)
|
||||
treasuryReward.Div(treasuryReward, big.NewInt(100))
|
||||
// Accumulate the rewards for the miner and any included uncles
|
||||
r := new(big.Int)
|
||||
|
|
@ -633,11 +634,3 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
|
|||
state.AddBalance(header.Coinbase, reward)
|
||||
}
|
||||
|
||||
// getTreasuryPercent computes the current block reward's percent will be for
|
||||
// dev subsidy.
|
||||
func getTreasuryPercent(header *types.Header) int64 {
|
||||
factorReduction := new(big.Int).Set(header.Number)
|
||||
factorReduction.Div(factorReduction, big.NewInt(2160000))
|
||||
|
||||
return 30 - (2 * factorReduction.Int64())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,5 @@ var DiscoveryV5Bootnodes = []string{
|
|||
// CallistoTestnetBootnodes are the enode URLs of the P2P bootstrap nodes for the
|
||||
// Callisto tes network.
|
||||
var CallistoTestnetBootnodes = []string{
|
||||
"enode://6b857ecbb4ea5e4469cb132eb07a5885a346d34c34588ce3e40f27a9cd134db6da44eb76f6b0bb856361daa5045ad2333e1273e781209f2ec2a6be617554432e@138.197.90.157:30303",
|
||||
"enode://c19ce20fa8d079c488ec27e6defd4b0b7e17a4df667e9f9436ff54841f637db051cd43aecb7350c6ddcd2056597878a420d9083dec4076ab68e93c619bdbe77c@104.131.103.14:30303",
|
||||
"enode://5c0cef5656d2b6c7baee7bb2362b37c96930988622c397885510546cf19f53f4c3c572bca3e0326139502ad28111935e1efcdaa1e6360bbf65c269212802b509@192.168.0.2:30303",
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue