channeldb: return ErrNoPendingCommit in case of no channel bucket

This commit is contained in:
Johan T. Halseth 2018-05-04 15:25:05 +02:00
parent 9324bf7b1d
commit f26ec38a74
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -1223,7 +1223,9 @@ func (c *OpenChannel) RemoteCommitChainTip() (*CommitDiff, error) {
err := c.Db.View(func(tx *bolt.Tx) error { err := c.Db.View(func(tx *bolt.Tx) error {
chanBucket, err := readChanBucket(tx, c.IdentityPub, chanBucket, err := readChanBucket(tx, c.IdentityPub,
&c.FundingOutpoint, c.ChainHash) &c.FundingOutpoint, c.ChainHash)
if err != nil { if err == ErrNoActiveChannels || err == ErrNoChanDBExists {
return ErrNoPendingCommit
} else if err != nil {
return err return err
} }