aboutsummaryrefslogtreecommitdiffstats
path: root/block_pool.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-02 18:52:56 +0800
committerobscuren <geffobscura@gmail.com>2014-12-02 18:52:56 +0800
commit64f35ba8d1f31d6821a0a1bf946c71396a996f30 (patch)
tree375a081536c7c0b329a3b0c2e812ff05f81dd64c /block_pool.go
parent616066a598933df7ef126186eb9c647094f665ca (diff)
parent99481a245adc2c4814ab6b38d94d63114f7bbb15 (diff)
downloaddexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar
dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.gz
dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.bz2
dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.lz
dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.xz
dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.zst
dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.zip
merge errors fixed
Diffstat (limited to 'block_pool.go')
-rw-r--r--block_pool.go23
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())
}
}
}