diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-31 17:59:17 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-31 17:59:17 +0800 |
commit | 3ee0461cb5b6e4a5e2d287180afbdb681805a662 (patch) | |
tree | f245667a9e3f5f0ff23bb1c89f4f7cc783f4949c /block_pool.go | |
parent | 8e0a39f33f9d24ebeca9cc88edf24cc6294552d7 (diff) | |
download | go-tangerine-3ee0461cb5b6e4a5e2d287180afbdb681805a662.tar.gz go-tangerine-3ee0461cb5b6e4a5e2d287180afbdb681805a662.tar.zst go-tangerine-3ee0461cb5b6e4a5e2d287180afbdb681805a662.zip |
Moved ethchain to chain
Diffstat (limited to 'block_pool.go')
-rw-r--r-- | block_pool.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/block_pool.go b/block_pool.go index 334db9c1b..49fa07eb1 100644 --- a/block_pool.go +++ b/block_pool.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/ethchain" + "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/ethlog" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/ethwire" @@ -20,7 +20,7 @@ var poollogger = ethlog.NewLogger("BPOOL") type block struct { from *Peer peer *Peer - block *ethchain.Block + block *chain.Block reqAt time.Time requested int } @@ -73,7 +73,7 @@ func (self *BlockPool) HasCommonHash(hash []byte) bool { return self.eth.ChainManager().GetBlock(hash) != nil } -func (self *BlockPool) Blocks() (blocks ethchain.Blocks) { +func (self *BlockPool) Blocks() (blocks chain.Blocks) { for _, item := range self.pool { if item.block != nil { blocks = append(blocks, item.block) @@ -123,15 +123,15 @@ func (self *BlockPool) AddHash(hash []byte, peer *Peer) { } } -func (self *BlockPool) Add(b *ethchain.Block, peer *Peer) { +func (self *BlockPool) Add(b *chain.Block, peer *Peer) { self.addBlock(b, peer, false) } -func (self *BlockPool) AddNew(b *ethchain.Block, peer *Peer) { +func (self *BlockPool) AddNew(b *chain.Block, peer *Peer) { self.addBlock(b, peer, true) } -func (self *BlockPool) addBlock(b *ethchain.Block, peer *Peer, newBlock bool) { +func (self *BlockPool) addBlock(b *chain.Block, peer *Peer, newBlock bool) { self.mut.Lock() defer self.mut.Unlock() @@ -262,7 +262,7 @@ out: /* if !self.fetchingHashes { blocks := self.Blocks() - ethchain.BlockBy(ethchain.Number).Sort(blocks) + chain.BlockBy(chain.Number).Sort(blocks) if len(blocks) > 0 { if !self.eth.ChainManager().HasBlock(b.PrevHash) && self.pool[string(b.PrevHash)] == nil && !self.fetchingHashes { @@ -283,7 +283,7 @@ out: break out case <-procTimer.C: blocks := self.Blocks() - ethchain.BlockBy(ethchain.Number).Sort(blocks) + chain.BlockBy(chain.Number).Sort(blocks) // Find common block for i, block := range blocks { |