OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix block fetcher block insert bug (#95)
[bytom/vapor.git]
/
netsync
/
consensusmgr
/
block_fetcher.go
diff --git
a/netsync/consensusmgr/block_fetcher.go
b/netsync/consensusmgr/block_fetcher.go
index
6278c61
..
3b6c746
100644
(file)
--- a/
netsync/consensusmgr/block_fetcher.go
+++ b/
netsync/consensusmgr/block_fetcher.go
@@
-40,10
+40,9
@@
func newBlockFetcher(chain Chain, peers *peers.PeerSet) *blockFetcher {
func (f *blockFetcher) blockProcessor() {
for {
func (f *blockFetcher) blockProcessor() {
for {
- height := f.chain.BestBlockHeight()
for !f.queue.Empty() {
msg := f.queue.PopItem().(*blockMsg)
for !f.queue.Empty() {
msg := f.queue.PopItem().(*blockMsg)
- if msg.block.Height >
height
+1 {
+ if msg.block.Height >
f.chain.BestBlockHeight()
+1 {
f.queue.Push(msg, -float32(msg.block.Height))
break
}
f.queue.Push(msg, -float32(msg.block.Height))
break
}