OSDN Git Service
(root)
/
bytom
/
bytom-spv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c72d497
)
Fix chain's height is 0
author
gguoss
<1536310027@qq.com>
Fri, 3 Nov 2017 07:01:02 +0000
(15:01 +0800)
committer
gguoss
<1536310027@qq.com>
Fri, 3 Nov 2017 07:01:02 +0000
(15:01 +0800)
protocol/protocol.go
patch
|
blob
|
history
diff --git
a/protocol/protocol.go
b/protocol/protocol.go
index
9297018
..
ac838fd
100644
(file)
--- a/
protocol/protocol.go
+++ b/
protocol/protocol.go
@@
-168,6
+168,9
@@
func NewChain(initialBlockHash bc.Hash, store Store, txPool *TxPool) (*Chain, er
func (c *Chain) Height() uint64 {
c.state.cond.L.Lock()
defer c.state.cond.L.Unlock()
+ if c.state.block == nil {
+ return 0
+ }
return c.state.block.Height
}