aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-29 21:20:42 +0800
committerobscuren <geffobscura@gmail.com>2014-10-29 21:20:42 +0800
commit9e2f071d26d5c4ed343d2a91e48fec4e7751b99d (patch)
treefdfde82ceb0c6736b82c08c7002055ee95cfef67 /ethchain/block.go
parentfb4113dab4df8480c77bdcb707fa6b5408755b79 (diff)
downloaddexon-9e2f071d26d5c4ed343d2a91e48fec4e7751b99d.tar.gz
dexon-9e2f071d26d5c4ed343d2a91e48fec4e7751b99d.tar.zst
dexon-9e2f071d26d5c4ed343d2a91e48fec4e7751b99d.zip
Removed events from the state manager
Diffstat (limited to 'ethchain/block.go')
-rw-r--r--ethchain/block.go34
1 files changed, 11 insertions, 23 deletions
diff --git a/ethchain/block.go b/ethchain/block.go
index e4a1aaf24..b31d68e4d 100644
--- a/ethchain/block.go
+++ b/ethchain/block.go
@@ -5,7 +5,6 @@ import (
"fmt"
"math/big"
"sort"
- _ "strconv"
"time"
"github.com/ethereum/go-ethereum/ethcrypto"
@@ -240,15 +239,19 @@ func (block *Block) SetUncles(uncles []*Block) {
block.UncleSha = ethcrypto.Sha3(ethutil.Encode(block.rlpUncles()))
}
-func (self *Block) SetReceipts(receipts []*Receipt, txs []*Transaction) {
+func (self *Block) SetReceipts(receipts Receipts) {
self.receipts = receipts
+ self.SetReceiptHash(receipts)
+}
+
+func (self *Block) SetTransactions(txs Transactions) {
self.setTransactions(txs)
+ self.SetTransactionHash(txs)
}
-func (block *Block) setTransactions(txs []*Transaction) {
+func (block *Block) setTransactions(txs Transactions) {
block.transactions = txs
-
- block.LogsBloom = CreateBloom(txs)
+ block.LogsBloom = CreateBloom(block)
}
func (self *Block) SetTransactionHash(transactions Transactions) {
@@ -424,22 +427,7 @@ func (self *Block) Size() ethutil.StorageSize {
return ethutil.StorageSize(len(self.RlpEncode()))
}
-/*
-func DeriveReceiptHash(receipts Receipts) (sha []byte) {
- trie := ethtrie.New(ethutil.Config.Db, "")
- for i, receipt := range receipts {
- trie.Update(string(ethutil.NewValue(i).Encode()), string(ethutil.NewValue(receipt.RlpData()).Encode()))
- }
-
- switch trie.Root.(type) {
- case string:
- sha = []byte(trie.Root.(string))
- case []byte:
- sha = trie.Root.([]byte)
- default:
- panic(fmt.Sprintf("invalid root type %T", trie.Root))
- }
-
- return sha
+// Implement RlpEncodable
+func (self *Block) RlpData() interface{} {
+ return self.Value().Val
}
-*/