diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-12 10:20:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:53 +0800 |
commit | f5a74ed705ebd6f58d724b007de8718f2da6aac2 (patch) | |
tree | 914ad4d51e4843a531c0c94a98f05942ea75ed8a /core/genesis.go | |
parent | 3f97380de3d19ddff60e13845fe94b8816c64427 (diff) | |
download | dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.tar dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.tar.gz dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.tar.bz2 dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.tar.lz dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.tar.xz dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.tar.zst dexon-f5a74ed705ebd6f58d724b007de8718f2da6aac2.zip |
core: fix staked calculation in genesis (#8)
Diffstat (limited to 'core/genesis.go')
-rw-r--r-- | core/genesis.go | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/core/genesis.go b/core/genesis.go index b444ea4fe..cc3a0750c 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -268,7 +268,6 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block { for addr, account := range g.Alloc { // For DEXON consensus genesis staking. if g.Config != nil && g.Config.Dexcon != nil { - account.Staked = big.NewInt(0) statedb.AddBalance(addr, new(big.Int).Sub(account.Balance, account.Staked)) totalStaked = new(big.Int).Add(totalStaked, account.Staked) } else { @@ -296,9 +295,6 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block { for _, addr := range keys { account := g.Alloc[addr] - if account.Staked == nil { - account.Staked = big.NewInt(0) - } if account.Staked.Cmp(big.NewInt(0)) > 0 { govStateHelper.Stake(addr, account.PublicKey, account.Staked, account.NodeInfo.Name, account.NodeInfo.Email, |