diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-02 18:52:56 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-02 18:52:56 +0800 |
commit | 64f35ba8d1f31d6821a0a1bf946c71396a996f30 (patch) | |
tree | 375a081536c7c0b329a3b0c2e812ff05f81dd64c /block_pool.go | |
parent | 616066a598933df7ef126186eb9c647094f665ca (diff) | |
parent | 99481a245adc2c4814ab6b38d94d63114f7bbb15 (diff) | |
download | go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.gz go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.bz2 go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.lz go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.xz go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.zst go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.zip |
merge errors fixed
Diffstat (limited to 'block_pool.go')
-rw-r--r-- | block_pool.go | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/block_pool.go b/block_pool.go index 38302a4c7..bb459cc7d 100644 --- a/block_pool.go +++ b/block_pool.go @@ -9,11 +9,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/chain/types" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/wire" ) @@ -312,11 +310,10 @@ out: } if len(blocks) > 0 { - chainManager := self.eth.ChainManager() - // Test and import - bchain := chain.NewChain(blocks) - _, err := chainManager.TestChain(bchain) - if err != nil && !chain.IsTDError(err) { + chainman := self.eth.ChainManager() + + err := chainman.InsertChain(blocks) + if err != nil { poollogger.Debugln(err) self.Reset() @@ -330,16 +327,10 @@ out: self.peer.StopWithReason(DiscBadPeer) self.td = ethutil.Big0 self.peer = nil - } else { - if !chain.IsTDError(err) { - chainManager.InsertChain(bchain, func(block *types.Block, messages state.Messages) { - self.eth.EventMux().Post(chain.NewBlockEvent{block}) - self.eth.EventMux().Post(messages) - - self.Remove(block.Hash()) - }) + } - } + for _, block := range blocks { + self.Remove(block.Hash()) } } } |