discovery: update utils to properly include opaque data in gossip msgs

This commit is contained in:
Olaoluwa Osuntokun 2018-08-31 20:13:14 -07:00
parent a35bdd4233
commit 0fc20cee64
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -23,13 +23,14 @@ func CreateChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
// authenticated channel announcement. // authenticated channel announcement.
chanID := lnwire.NewShortChanIDFromInt(chanInfo.ChannelID) chanID := lnwire.NewShortChanIDFromInt(chanInfo.ChannelID)
chanAnn := &lnwire.ChannelAnnouncement{ chanAnn := &lnwire.ChannelAnnouncement{
ShortChannelID: chanID, ShortChannelID: chanID,
NodeID1: chanInfo.NodeKey1Bytes, NodeID1: chanInfo.NodeKey1Bytes,
NodeID2: chanInfo.NodeKey2Bytes, NodeID2: chanInfo.NodeKey2Bytes,
ChainHash: chanInfo.ChainHash, ChainHash: chanInfo.ChainHash,
BitcoinKey1: chanInfo.BitcoinKey1Bytes, BitcoinKey1: chanInfo.BitcoinKey1Bytes,
BitcoinKey2: chanInfo.BitcoinKey2Bytes, BitcoinKey2: chanInfo.BitcoinKey2Bytes,
Features: lnwire.NewRawFeatureVector(), Features: lnwire.NewRawFeatureVector(),
ExtraOpaqueData: chanInfo.ExtraOpaqueData,
} }
var err error var err error
@ -76,6 +77,7 @@ func CreateChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
HtlcMinimumMsat: e1.MinHTLC, HtlcMinimumMsat: e1.MinHTLC,
BaseFee: uint32(e1.FeeBaseMSat), BaseFee: uint32(e1.FeeBaseMSat),
FeeRate: uint32(e1.FeeProportionalMillionths), FeeRate: uint32(e1.FeeProportionalMillionths),
ExtraOpaqueData: e1.ExtraOpaqueData,
} }
edge1Ann.Signature, err = lnwire.NewSigFromRawSignature(e1.SigBytes) edge1Ann.Signature, err = lnwire.NewSigFromRawSignature(e1.SigBytes)
if err != nil { if err != nil {
@ -92,6 +94,7 @@ func CreateChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
HtlcMinimumMsat: e2.MinHTLC, HtlcMinimumMsat: e2.MinHTLC,
BaseFee: uint32(e2.FeeBaseMSat), BaseFee: uint32(e2.FeeBaseMSat),
FeeRate: uint32(e2.FeeProportionalMillionths), FeeRate: uint32(e2.FeeProportionalMillionths),
ExtraOpaqueData: e2.ExtraOpaqueData,
} }
edge2Ann.Signature, err = lnwire.NewSigFromRawSignature(e2.SigBytes) edge2Ann.Signature, err = lnwire.NewSigFromRawSignature(e2.SigBytes)
if err != nil { if err != nil {