Merge pull request #3257 from Crypt-iQ/restorechanbackup_fix_0630

chanrestore: return error instead of nil if failed derivation
This commit is contained in:
Olaoluwa Osuntokun 2019-07-01 15:40:36 -07:00 committed by GitHub
commit 108f25dc89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,7 +41,7 @@ func (c *chanDBRestorer) openChannelShell(backup chanbackup.Single) (
// shachain... // shachain...
privKey, err := c.secretKeys.DerivePrivKey(backup.ShaChainRootDesc) privKey, err := c.secretKeys.DerivePrivKey(backup.ShaChainRootDesc)
if err != nil { if err != nil {
return nil, nil return nil, fmt.Errorf("unable to derive shachain root key: %v", err)
} }
revRoot, err := chainhash.NewHash(privKey.Serialize()) revRoot, err := chainhash.NewHash(privKey.Serialize())
if err != nil { if err != nil {