diff options
author | Bas van Kervel <bas@ethdev.com> | 2016-07-26 22:37:04 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2016-08-16 21:21:22 +0800 |
commit | bb8059f6aa86d1052d7c2dd75a6985982cb278f4 (patch) | |
tree | 44c57f98592518652f9791655be98c75fc198760 /core/database_util.go | |
parent | 4c2cc32f2e279baa3059603b8c8a4329f31606f6 (diff) | |
download | go-tangerine-bb8059f6aa86d1052d7c2dd75a6985982cb278f4.tar.gz go-tangerine-bb8059f6aa86d1052d7c2dd75a6985982cb278f4.tar.zst go-tangerine-bb8059f6aa86d1052d7c2dd75a6985982cb278f4.zip |
core: ensure the canonical block is written before the canonical hash is set
Diffstat (limited to 'core/database_util.go')
-rw-r--r-- | core/database_util.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/database_util.go b/core/database_util.go index 1529d7369..5f9afe6ba 100644 --- a/core/database_util.go +++ b/core/database_util.go @@ -204,7 +204,11 @@ func GetTd(db ethdb.Database, hash common.Hash, number uint64) *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, number uint64) *types.Block { // Retrieve the block header and body contents header := GetHeader(db, hash, number) |