diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-20 18:00:36 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-20 18:00:36 +0800 |
commit | 8fe8ec84f6a0cbc51d6018af7269952062279234 (patch) | |
tree | 764f9206eeb976c08e4d655c96a958e2569e3e0b /xeth/xeth.go | |
parent | 0300eef94d7d1e58bc5cf94094a3d492c70486e1 (diff) | |
parent | 00ec4132f89527a6e2ae6b1d3842c447cab38cef (diff) | |
download | dexon-8fe8ec84f6a0cbc51d6018af7269952062279234.tar.gz dexon-8fe8ec84f6a0cbc51d6018af7269952062279234.tar.zst dexon-8fe8ec84f6a0cbc51d6018af7269952062279234.zip |
Merge pull request #1049 from zsfelfoldi/receipts
Storing tx receipts in extraDb
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r-- | xeth/xeth.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 4925fe635..3ec3f7dd4 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -354,6 +354,24 @@ func (self *XEth) CurrentBlock() *types.Block { return self.backend.ChainManager().CurrentBlock() } +func (self *XEth) GetBlockReceipts(bhash common.Hash) (receipts types.Receipts, err error) { + return self.backend.BlockProcessor().GetBlockReceipts(bhash) +} + +func (self *XEth) GetTxReceipt(txhash common.Hash) (receipt *types.Receipt, err error) { + _, bhash, _, txi := self.EthTransactionByHash(common.ToHex(txhash[:])) + var receipts types.Receipts + receipts, err = self.backend.BlockProcessor().GetBlockReceipts(bhash) + if err == nil { + if txi < uint64(len(receipts)) { + receipt = receipts[txi] + } else { + err = fmt.Errorf("Invalid tx index") + } + } + return +} + func (self *XEth) GasLimit() *big.Int { return self.backend.ChainManager().GasLimit() } |