netann: decode features when creating chan ann from stored chan info

This was the only field not properly set when creating a
lnwire.ChannelAnnouncement from a channeldb.ChannelEdgeInfo.
This commit is contained in:
Wilmer Paulino
2020-06-01 17:06:08 -07:00
parent bdc0d875bc
commit d0fe8b737b
2 changed files with 73 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
package netann
import (
"bytes"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lnwire"
)
@@ -30,7 +32,10 @@ func CreateChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
ExtraOpaqueData: chanInfo.ExtraOpaqueData,
}
var err error
err := chanAnn.Features.Decode(bytes.NewReader(chanInfo.Features))
if err != nil {
return nil, nil, nil, err
}
chanAnn.BitcoinSig1, err = lnwire.NewSigFromRawSignature(
chanProof.BitcoinSig1Bytes,
)