diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-06-13 21:16:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-13 21:16:09 +0800 |
commit | a38be3eb488a349693a9c9905ab015278281f8db (patch) | |
tree | 34fa99ba38f421d9c7ffd308ed544cd5053df228 /core/genesis.go | |
parent | 73c028c40a4f1336a0ab4b9773be0a9d7719777f (diff) | |
parent | f9917c8c7b6d16daadebd72977e56a8adc0382b0 (diff) | |
download | dexon-a38be3eb488a349693a9c9905ab015278281f8db.tar.gz dexon-a38be3eb488a349693a9c9905ab015278281f8db.tar.zst dexon-a38be3eb488a349693a9c9905ab015278281f8db.zip |
Merge pull request #2455 from zsfelfoldi/chaindb
core: improved chain db performance by using sequential keys
Diffstat (limited to 'core/genesis.go')
-rw-r--r-- | core/genesis.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/genesis.go b/core/genesis.go index 40d799621..637b63320 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -88,7 +88,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block, Root: root, }, nil, nil, nil) - if block := GetBlock(chainDb, block.Hash()); block != nil { + if block := GetBlock(chainDb, block.Hash(), block.NumberU64()); block != nil { glog.V(logger.Info).Infoln("Genesis block already in chain. Writing canonical number") err := WriteCanonicalHash(chainDb, block.Hash(), block.NumberU64()) if err != nil { @@ -100,13 +100,13 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block, if err := stateBatch.Write(); err != nil { return nil, fmt.Errorf("cannot write state: %v", err) } - if err := WriteTd(chainDb, block.Hash(), difficulty); err != nil { + if err := WriteTd(chainDb, block.Hash(), block.NumberU64(), difficulty); err != nil { return nil, err } if err := WriteBlock(chainDb, block); err != nil { return nil, err } - if err := WriteBlockReceipts(chainDb, block.Hash(), nil); err != nil { + if err := WriteBlockReceipts(chainDb, block.Hash(), block.NumberU64(), nil); err != nil { return nil, err } if err := WriteCanonicalHash(chainDb, block.Hash(), block.NumberU64()); err != nil { |