mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
minor fixes found during debug
This commit is contained in:
parent
8704f12349
commit
4d68af307e
3 changed files with 3 additions and 2 deletions
|
|
@ -472,7 +472,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
|
||||||
// then generate chain on top.
|
// then generate chain on top.
|
||||||
func GenerateChainWithGenesis(genesis *Genesis, engine consensus.Engine, n int, gen func(int, *BlockGen)) (ethdb.Database, []*types.Block, []types.Receipts) {
|
func GenerateChainWithGenesis(genesis *Genesis, engine consensus.Engine, n int, gen func(int, *BlockGen)) (ethdb.Database, []*types.Block, []types.Receipts) {
|
||||||
db := rawdb.NewMemoryDatabase()
|
db := rawdb.NewMemoryDatabase()
|
||||||
triedb := triedb.NewDatabase(db, triedb.HashDefaults)
|
triedb := triedb.NewDatabase(db, triedb.VerkleDefaults)
|
||||||
defer triedb.Close()
|
defer triedb.Close()
|
||||||
_, err := genesis.Commit(db, triedb)
|
_, err := genesis.Commit(db, triedb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ func (h HashedNode) toDot(parent string, path string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h HashedNode) CollectNodes([]byte, NodeFlushFn) error {
|
func (h HashedNode) CollectNodes([]byte, NodeFlushFn) error {
|
||||||
|
// HashedNodes are already persisted in the database and don't need to be collected.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ func (t *BinaryTrie) Commit(_ bool) (common.Hash, *trienode.NodeSet) {
|
||||||
// The root can be any type of BinaryNode (InternalNode, StemNode, etc.)
|
// The root can be any type of BinaryNode (InternalNode, StemNode, etc.)
|
||||||
err := t.root.CollectNodes(nil, func(path []byte, node BinaryNode) {
|
err := t.root.CollectNodes(nil, func(path []byte, node BinaryNode) {
|
||||||
serialized := SerializeNode(node)
|
serialized := SerializeNode(node)
|
||||||
nodeset.AddNode(path, trienode.NewNodeWithPrev(common.Hash{}, serialized, t.tracer.Get(path)))
|
nodeset.AddNode(path, trienode.NewNodeWithPrev(node.Hash(), serialized, t.tracer.Get(path)))
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("CollectNodes failed: %v", err))
|
panic(fmt.Errorf("CollectNodes failed: %v", err))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue