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
Revert "log into file (#357)"
[bytom/vapor.git]
/
protocol
/
protocol.go
diff --git
a/protocol/protocol.go
b/protocol/protocol.go
index
314b568
..
d7ea944
100644
(file)
--- a/
protocol/protocol.go
+++ b/
protocol/protocol.go
@@
-201,7
+201,9
@@
func (c *Chain) setState(blockHeader, irrBlockHeader *types.BlockHeader, mainBlo
func (c *Chain) BlockWaiter(height uint64) <-chan struct{} {
ch := make(chan struct{}, 1)
go func() {
func (c *Chain) BlockWaiter(height uint64) <-chan struct{} {
ch := make(chan struct{}, 1)
go func() {
- for bestHeight := c.BestBlockHeight(); bestHeight < height; bestHeight = c.BestBlockHeight() {
+ c.cond.L.Lock()
+ defer c.cond.L.Unlock()
+ for c.bestBlockHeader.Height < height {
c.cond.Wait()
}
ch <- struct{}{}
c.cond.Wait()
}
ch <- struct{}{}