aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-12 10:20:27 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitefaa2aaf3bef419c18eccc5ea33555d41060dd98 (patch)
tree6c6bd24f9310bbf2d8137f8f994fa6cffb6742d6 /core
parentaa0a3d80802bd137a661a8562f796d6f4763eac4 (diff)
downloaddexon-efaa2aaf3bef419c18eccc5ea33555d41060dd98.tar.gz
dexon-efaa2aaf3bef419c18eccc5ea33555d41060dd98.tar.zst
dexon-efaa2aaf3bef419c18eccc5ea33555d41060dd98.zip
core: fix staked calculation in genesis (#8)
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 9ba42bacf..1b7a3666e 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,