aboutsummaryrefslogtreecommitdiffstats
path: root/core/genesis.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 2412ede30..8b957edd2 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -257,6 +257,9 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
totalStaked := big.NewInt(0)
for addr, account := range g.Alloc {
+ if account.Staked == nil {
+ account.Staked = big.NewInt(0)
+ }
statedb.AddBalance(addr, new(big.Int).Sub(account.Balance, account.Staked))
statedb.SetCode(addr, account.Code)
statedb.SetNonce(addr, account.Nonce)
@@ -278,6 +281,9 @@ 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)
}