lightning: in derivePrivKey, only do not HD derive if there is a pubkey
This commit is contained in:
parent
3bc81164a1
commit
251e5d0fd2
@ -828,15 +828,13 @@ def privKeyForPubKey(pubKey):
|
||||
def derivePrivKey(keyDesc):
|
||||
keyDescFam = keyDesc.keyLocator.family
|
||||
keyDescIdx = keyDesc.keyLocator.index
|
||||
if keyDescFam == 0: keyDescFam = None
|
||||
if keyDescIdx == 0: keyDescIdx = None
|
||||
keyDescPubKey = keyDesc.pubKey
|
||||
privKey = None
|
||||
|
||||
if len(keyDescPubKey) != 0:
|
||||
privKey = privKeyForPubKey(keyDescPubKey)
|
||||
else:
|
||||
assert keyDescFam is not None and keyDescIdx is not None
|
||||
if keyDescFam == 0: keyDescFam = None
|
||||
if keyDescIdx == 0: keyDescIdx = None
|
||||
|
||||
return fetchPrivKey(None, keyDescFam, keyDescIdx, privKey)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user