channeldb: sent internal db pointer in FetchOpenChannels

This commit fixes a bug which would potentially cause a panic if a
channel returned from FetchOpenChannels attempted to access the
internal pointer to the database.

To fix this bug, the pointer is now properly set once the channel has
been loaded from the database.
This commit is contained in:
Olaoluwa Osuntokun 2016-06-22 22:01:10 -07:00
parent 6b53b393df
commit 07bc7bbd42
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -177,6 +177,7 @@ func (d *DB) FetchOpenChannels(nodeID *wire.ShaHash) ([]*OpenChannel, error) {
if err != nil {
return err
}
oChannel.Db = d
channels = append(channels, oChannel)
return nil