discovery+lnd: create new chanSeries impl of the ChannelGraphTimeSeries interface

In this commit, we create a new concrete implementation for the new
discovery.ChannelGraphTimeSeries interface. We also export the
createChannelAnnouncement method to allow the chanSeries struct to
re-use the existing code for creating wire messages from the database
structs.
This commit is contained in:
Olaoluwa Osuntokun
2018-04-16 19:09:11 -07:00
parent 12e73f55e9
commit 0016b3f458
3 changed files with 321 additions and 6 deletions

View File

@@ -8,12 +8,12 @@ import (
"github.com/roasbeef/btcd/btcec"
)
// createChanAnnouncement is a helper function which creates all channel
// CreateChanAnnouncement is a helper function which creates all channel
// announcements given the necessary channel related database items. This
// function is used to transform out database structs into the corresponding wire
// structs for announcing new channels to other peers, or simply syncing up a
// peer's initial routing table upon connect.
func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
func CreateChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
chanInfo *channeldb.ChannelEdgeInfo,
e1, e2 *channeldb.ChannelEdgePolicy) (*lnwire.ChannelAnnouncement,
*lnwire.ChannelUpdate, *lnwire.ChannelUpdate, error) {