mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-20 14:59:26 +00:00
persist access list correctly
This commit is contained in:
parent
206eb81148
commit
2266891ece
1 changed files with 8 additions and 8 deletions
|
|
@ -693,15 +693,12 @@ func ReadBlock(db ethdb.Reader, hash common.Hash, number uint64) *types.Block {
|
||||||
|
|
||||||
block := types.NewBlockWithHeader(header).WithBody(*body)
|
block := types.NewBlockWithHeader(header).WithBody(*body)
|
||||||
|
|
||||||
// TODO: only read the access list if the bal hash is set in the header.
|
if header.BlockAccessListHash != nil {
|
||||||
// I do it here regardless in order to support --experimental.bal which
|
accessList := ReadAccessList(db, hash, number)
|
||||||
// doesn't expect bal hash to be set in header in order to be compatible
|
if accessList != nil {
|
||||||
// with importing mainnet blocks augmented with BALs
|
block = block.WithAccessList(accessList)
|
||||||
accessList := ReadAccessList(db, hash, number)
|
}
|
||||||
if accessList != nil {
|
|
||||||
block = block.WithAccessList(accessList)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return block
|
return block
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -709,6 +706,9 @@ func ReadBlock(db ethdb.Reader, hash common.Hash, number uint64) *types.Block {
|
||||||
func WriteBlock(db ethdb.KeyValueWriter, block *types.Block) {
|
func WriteBlock(db ethdb.KeyValueWriter, block *types.Block) {
|
||||||
WriteBody(db, block.Hash(), block.NumberU64(), block.Body())
|
WriteBody(db, block.Hash(), block.NumberU64(), block.Body())
|
||||||
WriteHeader(db, block.Header())
|
WriteHeader(db, block.Header())
|
||||||
|
if block.AccessList() != nil {
|
||||||
|
WriteAccessList(db, block.Hash(), block.NumberU64(), block.AccessList())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteAncientBlocks writes entire block data into ancient store and returns the total written size.
|
// WriteAncientBlocks writes entire block data into ancient store and returns the total written size.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue