|
|
@ -250,11 +250,11 @@ func (t *StateTrie) Witness() map[string]struct{} { |
|
|
|
func (t *StateTrie) Commit(collectLeaf bool) (common.Hash, *trienode.NodeSet) { |
|
|
|
func (t *StateTrie) Commit(collectLeaf bool) (common.Hash, *trienode.NodeSet) { |
|
|
|
// Write all the pre-images to the actual disk database
|
|
|
|
// Write all the pre-images to the actual disk database
|
|
|
|
if len(t.getSecKeyCache()) > 0 { |
|
|
|
if len(t.getSecKeyCache()) > 0 { |
|
|
|
|
|
|
|
if t.preimages != nil { |
|
|
|
preimages := make(map[common.Hash][]byte, len(t.secKeyCache)) |
|
|
|
preimages := make(map[common.Hash][]byte, len(t.secKeyCache)) |
|
|
|
for hk, key := range t.secKeyCache { |
|
|
|
for hk, key := range t.secKeyCache { |
|
|
|
preimages[common.BytesToHash([]byte(hk))] = key |
|
|
|
preimages[common.BytesToHash([]byte(hk))] = key |
|
|
|
} |
|
|
|
} |
|
|
|
if t.preimages != nil { |
|
|
|
|
|
|
|
t.preimages.InsertPreimage(preimages) |
|
|
|
t.preimages.InsertPreimage(preimages) |
|
|
|
} |
|
|
|
} |
|
|
|
t.secKeyCache = make(map[string][]byte) |
|
|
|
t.secKeyCache = make(map[string][]byte) |
|
|
|