diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-10-01 00:23:31 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-10-19 15:03:09 +0800 |
commit | 832b37c8221e330896c36eb419d92af6b1fdc9dd (patch) | |
tree | fdeb701ed7a17ef2db176b7cbf1b1159b5afb417 /core/types | |
parent | 42c8afd44006b170c20159abaadc31cc7545bec2 (diff) | |
download | go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.gz go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.bz2 go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.lz go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.xz go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.tar.zst go-tangerine-832b37c8221e330896c36eb419d92af6b1fdc9dd.zip |
core, eth: receipt chain reconstruction
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/block.go | 5 | ||||
-rw-r--r-- | core/types/receipt.go | 4 |
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 |