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:
6f02c86
)
add lock to create-key (#495)
author
Yongfeng LI
<wliyongfeng@gmail.com>
Wed, 28 Mar 2018 05:58:33 +0000
(13:58 +0800)
committer
Paladz
<yzhu101@uottawa.ca>
Wed, 28 Mar 2018 05:58:33 +0000
(13:58 +0800)
blockchain/pseudohsm/pseudohsm.go
patch
|
blob
|
history
diff --git
a/blockchain/pseudohsm/pseudohsm.go
b/blockchain/pseudohsm/pseudohsm.go
index
3511558
..
8bc162f
100644
(file)
--- a/
blockchain/pseudohsm/pseudohsm.go
+++ b/
blockchain/pseudohsm/pseudohsm.go
@@
-51,6
+51,10
@@
func (h *HSM) XCreate(alias string, auth string) (*XPub, error) {
if ok := h.cache.hasAlias(alias); ok {
return nil, ErrDuplicateKeyAlias
}
+
+ h.cacheMu.Lock()
+ defer h.cacheMu.Unlock()
+
xpub, _, err := h.createChainKDKey(auth, alias, false)
if err != nil {
return nil, err