mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: fix missing receipt
This commit is contained in:
parent
b0b65d017f
commit
b29bf9fcab
1 changed files with 9 additions and 0 deletions
|
|
@ -1672,6 +1672,15 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
|
||||||
"uncles", len(block.Uncles()), "txs", len(block.Transactions()), "gas", block.GasUsed(),
|
"uncles", len(block.Uncles()), "txs", len(block.Transactions()), "gas", block.GasUsed(),
|
||||||
"root", block.Root())
|
"root", block.Root())
|
||||||
|
|
||||||
|
// Special case. Commit the empty receipt slice if we meet the known
|
||||||
|
// block in the middle. It can only happen in the clique chain. Whenever
|
||||||
|
// we insert blocks via `insertSideChain`, we only commit `td`, `header`
|
||||||
|
// and `body` if it's non-existent. Since we don't have receipts without
|
||||||
|
// reexecution, so nothing to commit. But if the sidechain will be adpoted
|
||||||
|
// as the canonical chain eventually, it needs to be reexecuted for missing
|
||||||
|
// state, but if it's this special case here(skip reexecution) we will lose
|
||||||
|
// the empty receipt entry.
|
||||||
|
rawdb.WriteReceipts(bc.db, block.Hash(), block.NumberU64(), nil)
|
||||||
if err := bc.writeKnownBlock(block); err != nil {
|
if err := bc.writeKnownBlock(block); err != nil {
|
||||||
return it.index, err
|
return it.index, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue