mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
sort logs before getting bor block receipt logs
This commit is contained in:
parent
9539a72909
commit
0c21e1c6b5
1 changed files with 6 additions and 0 deletions
|
|
@ -1447,6 +1447,12 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
|
|||
|
||||
// storing bor block receipt
|
||||
blockLogs := state.Logs()
|
||||
if len(blockLogs) > 0 {
|
||||
sort.SliceStable(blockLogs, func(i, j int) bool {
|
||||
return blockLogs[i].Index < blockLogs[j].Index
|
||||
})
|
||||
}
|
||||
|
||||
if len(blockLogs) > len(logs) {
|
||||
rawdb.WriteBorReceipt(blockBatch, block.Hash(), block.NumberU64(), &types.BorReceiptForStorage{
|
||||
Logs: blockLogs[len(logs):],
|
||||
|
|
|
|||
Loading…
Reference in a new issue