aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-10-01 00:23:31 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-10-19 15:03:09 +0800
commit832b37c8221e330896c36eb419d92af6b1fdc9dd (patch)
treefdeb701ed7a17ef2db176b7cbf1b1159b5afb417 /core/types
parent42c8afd44006b170c20159abaadc31cc7545bec2 (diff)
downloaddexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar
dexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.gz
dexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.bz2
dexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.lz
dexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.xz
dexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.zst
dexon-832b37c8221e330896c36eb419d92af6b1fdc9dd.zip
core, eth: receipt chain reconstruction
Diffstat (limited to 'core/types')
-rw-r--r--core/types/block.go5
-rw-r--r--core/types/receipt.go4
2 files changed, 2 insertions, 7 deletions
diff --git a/core/types/block.go b/core/types/block.go
index c4377ffa1..1d1cfa515 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -128,7 +128,6 @@ type Block struct {
header *Header
uncles []*Header
transactions Transactions
- receipts Receipts
// caches
hash atomic.Value
@@ -200,8 +199,6 @@ func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*
} else {
b.header.ReceiptHash = DeriveSha(Receipts(receipts))
b.header.Bloom = CreateBloom(receipts)
- b.receipts = make([]*Receipt, len(receipts))
- copy(b.receipts, receipts)
}
if len(uncles) == 0 {
@@ -299,7 +296,6 @@ func (b *StorageBlock) DecodeRLP(s *rlp.Stream) error {
// TODO: copies
func (b *Block) Uncles() []*Header { return b.uncles }
func (b *Block) Transactions() Transactions { return b.transactions }
-func (b *Block) Receipts() Receipts { return b.receipts }
func (b *Block) Transaction(hash common.Hash) *Transaction {
for _, transaction := range b.transactions {
@@ -364,7 +360,6 @@ func (b *Block) WithMiningResult(nonce uint64, mixDigest common.Hash) *Block {
return &Block{
header: &cpy,
transactions: b.transactions,
- receipts: b.receipts,
uncles: b.uncles,
}
}
diff --git a/core/types/receipt.go b/core/types/receipt.go
index d85fe16cf..aea5b3e91 100644
--- a/core/types/receipt.go
+++ b/core/types/receipt.go
@@ -41,8 +41,8 @@ type Receipt struct {
}
// NewReceipt creates a barebone transaction receipt, copying the init fields.
-func NewReceipt(root []byte, cumalativeGasUsed *big.Int) *Receipt {
- return &Receipt{PostState: common.CopyBytes(root), CumulativeGasUsed: new(big.Int).Set(cumalativeGasUsed)}
+func NewReceipt(root []byte, cumulativeGasUsed *big.Int) *Receipt {
+ return &Receipt{PostState: common.CopyBytes(root), CumulativeGasUsed: new(big.Int).Set(cumulativeGasUsed)}
}
// EncodeRLP implements rlp.Encoder, and flattens the consensus fields of a receipt