From 90ad76258fdf93b58e39eb5f54500d716fb4ad67 Mon Sep 17 00:00:00 2001 From: Yohan Graterol Date: Wed, 21 Feb 2018 22:14:50 -0500 Subject: [PATCH] Treasury percents --- consensus/ethash/consensus.go | 13 +++---------- params/bootnodes.go | 3 +-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index aec110e247..256dcf29c5 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -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()) -} diff --git a/params/bootnodes.go b/params/bootnodes.go index bf5bddeff0..11beb03e69 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -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", }