aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-15 07:11:01 +0800
committerobscuren <geffobscura@gmail.com>2014-09-15 07:11:01 +0800
commit2f614900e82036e3e8f6f6a714efc43e09aca830 (patch)
tree6a9ad17e8f7f7f91c036d2fec2354d08a0025a6e /ethchain/block.go
parent4db4ec1621767513ed2bd99d835c3e2f1c2b0e7e (diff)
downloadgo-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.tar
go-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.tar.gz
go-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.tar.bz2
go-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.tar.lz
go-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.tar.xz
go-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.tar.zst
go-tangerine-2f614900e82036e3e8f6f6a714efc43e09aca830.zip
Updated GHOST
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