forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ethereum#90 from maticnetwork/block-receipt
Add state-sync logs into new tx/receipt
- Loading branch information
Showing
29 changed files
with
1,655 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package core | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/core/rawdb" | ||
"github.com/ethereum/go-ethereum/core/types" | ||
) | ||
|
||
// GetBorReceiptByHash retrieves the bor block receipt in a given block. | ||
func (bc *BlockChain) GetBorReceiptByHash(hash common.Hash) *types.Receipt { | ||
if receipt, ok := bc.borReceiptsCache.Get(hash); ok { | ||
return receipt.(*types.Receipt) | ||
} | ||
|
||
// read header from hash | ||
number := rawdb.ReadHeaderNumber(bc.db, hash) | ||
if number == nil { | ||
return nil | ||
} | ||
|
||
// read bor reciept by hash and number | ||
receipt := rawdb.ReadBorReceipt(bc.db, hash, *number) | ||
if receipt == nil { | ||
return nil | ||
} | ||
|
||
// add into bor receipt cache | ||
bc.borReceiptsCache.Add(hash, receipt) | ||
return receipt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.