diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-13 16:21:51 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:49 +0800 |
commit | 902f6508b7655cee0231bc5bd2ade9261f79f6f1 (patch) | |
tree | d2eb99c1a0da59d5c56b559ac2ec8b839eda403a /core | |
parent | 66f5c9d6b502bdf49d9888f328e07e7d860bd3b4 (diff) | |
download | go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.tar go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.tar.gz go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.tar.bz2 go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.tar.lz go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.tar.xz go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.tar.zst go-tangerine-902f6508b7655cee0231bc5bd2ade9261f79f6f1.zip |
dex: bug fix to allow running geth without crashing
Diffstat (limited to 'core')
-rw-r--r-- | core/genesis.go | 8 | ||||
-rw-r--r-- | core/vm/governance.go | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/core/genesis.go b/core/genesis.go index 149241cf5..043a9f428 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -32,7 +32,6 @@ import ( "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" "github.com/dexon-foundation/dexon/core/vm" - "github.com/dexon-foundation/dexon/crypto" "github.com/dexon-foundation/dexon/ethdb" "github.com/dexon-foundation/dexon/log" "github.com/dexon-foundation/dexon/params" @@ -248,13 +247,6 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block { // Stake in governance state. if account.Staked.Cmp(big.NewInt(0)) > 0 { - pk, err := crypto.DecompressPubkey(account.PublicKey) - if err != nil { - panic(err) - } - if crypto.PubkeyToAddress(*pk) != addr { - panic(fmt.Errorf("public key does not belones to %s", addr)) - } govStateHelper.Stake(addr, account.PublicKey, account.Staked) } } diff --git a/core/vm/governance.go b/core/vm/governance.go index 5bbb5a1ec..0cca0f409 100644 --- a/core/vm/governance.go +++ b/core/vm/governance.go @@ -1041,7 +1041,7 @@ func (s *GovernanceStateHelper) Node(index *big.Int) *nodeInfo { loc = new(big.Int).Add(elementBaseLoc, big.NewInt(2)) node.Staked = s.getStateBigInt(loc) - return nil + return node } func (s *GovernanceStateHelper) PushNode(n *nodeInfo) { // increase length by 1 |