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_nil_pointer_when_get_orphan_block (#565)
[bytom/vapor.git]
/
protocol
/
orphan_manage.go
diff --git
a/protocol/orphan_manage.go
b/protocol/orphan_manage.go
index
6808d81
..
bcb8925
100644
(file)
--- a/
protocol/orphan_manage.go
+++ b/
protocol/orphan_manage.go
@@
-80,6
+80,9
@@
func (o *OrphanManage) Get(hash *bc.Hash) (*types.Block, bool) {
o.mtx.RLock()
block, ok := o.orphan[*hash]
o.mtx.RUnlock()
+ if !ok {
+ return nil, ok
+ }
return block.Block, ok
}