aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain/block.go')
-rw-r--r--ethchain/block.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/ethchain/block.go b/ethchain/block.go
index d2d012e55..fde6ff04a 100644
--- a/ethchain/block.go
+++ b/ethchain/block.go
@@ -31,11 +31,22 @@ func (bi *BlockInfo) RlpEncode() []byte {
return ethutil.Encode([]interface{}{bi.Number, bi.Hash, bi.Parent})
}
+type Blocks []*Block
+
+func (self Blocks) AsSet() ethutil.UniqueSet {
+ set := make(ethutil.UniqueSet)
+ for _, block := range self {
+ set.Insert(block.Hash())
+ }
+
+ return set
+}
+
type Block struct {
// Hash to the previous block
PrevHash []byte
// Uncles of this block
- Uncles []*Block
+ Uncles Blocks
UncleSha []byte
// The coin base address
Coinbase []byte