From 2feb23c1dacf1cc7ef664d92f28b63dd46502f21 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Sat, 4 Jul 2015 02:25:04 +0200 Subject: core, eth, miner, xeth: receipt storage fix * Added GetReceiptsFromBlock, GetReceipt, PutReceipts * Added ContractAddress to receipt. See #1042 --- xeth/xeth.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'xeth/xeth.go') diff --git a/xeth/xeth.go b/xeth/xeth.go index 155ff3eea..cbc8dbbde 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -364,22 +364,12 @@ func (self *XEth) CurrentBlock() *types.Block { return self.backend.ChainManager().CurrentBlock() } -func (self *XEth) GetBlockReceipts(bhash common.Hash) (receipts types.Receipts, err error) { +func (self *XEth) GetBlockReceipts(bhash common.Hash) types.Receipts { 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) GetTxReceipt(txhash common.Hash) *types.Receipt { + return core.GetReceipt(self.backend.ExtraDb(), txhash) } func (self *XEth) GasLimit() *big.Int { -- cgit v1.2.3