[release/1.4.11] core: ensure the canonical block is written before the canonical hash is set
(cherry picked from commit bb8059f6aa
)
Conflicts:
core/blockchain.go
core/database_util.go
core/headerchain.go
eth/filters/filter.go
This commit is contained in:
committed by
Jeffrey Wilcke
parent
0ab7e90cbb
commit
c4ed34f008
@ -157,7 +157,11 @@ func GetTd(db ethdb.Database, hash common.Hash) *big.Int {
|
||||
}
|
||||
|
||||
// GetBlock retrieves an entire block corresponding to the hash, assembling it
|
||||
// back from the stored header and body.
|
||||
// back from the stored header and body. If either the header or body could not
|
||||
// be retrieved nil is returned.
|
||||
//
|
||||
// Note, due to concurrent download of header and block body the header and thus
|
||||
// canonical hash can be stored in the database but the body data not (yet).
|
||||
func GetBlock(db ethdb.Database, hash common.Hash) *types.Block {
|
||||
// Retrieve the block header and body contents
|
||||
header := GetHeader(db, hash)
|
||||
|
Reference in New Issue
Block a user