From 07bc7bbd4227d571b86ab72414b693386abc9b2b Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 22 Jun 2016 22:01:10 -0700 Subject: [PATCH] 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. --- channeldb/db.go | 1 + 1 file changed, 1 insertion(+) diff --git a/channeldb/db.go b/channeldb/db.go index 22d920428..7f15d3af8 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -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