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 13:49:56 +0800 |
commit | 8bb6abd7f40e88a18148799c9a8b4a42f7cc4aab (patch) | |
tree | c3cefbc095895cd94bd3b3e39de2e9c10ffaf88b /core/genesis.go | |
parent | e25deb471bf4fef449996d4616b6919e2302f7a0 (diff) | |
download | dexon-8bb6abd7f40e88a18148799c9a8b4a42f7cc4aab.tar.gz dexon-8bb6abd7f40e88a18148799c9a8b4a42f7cc4aab.tar.zst dexon-8bb6abd7f40e88a18148799c9a8b4a42f7cc4aab.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, |