diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 967f9ee94..894fccf52 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -2033,7 +2033,7 @@ func (d *AuthenticatedGossiper) processRejectedEdge(_ context.Context, } // fetchPKScript fetches the output script for the given SCID. -func (d *AuthenticatedGossiper) fetchPKScript(chanID *lnwire.ShortChannelID) ( +func (d *AuthenticatedGossiper) fetchPKScript(chanID lnwire.ShortChannelID) ( []byte, error) { return lnwallet.FetchPKScriptWithQuit(d.cfg.ChainIO, chanID, d.quit) @@ -3737,7 +3737,7 @@ func (d *AuthenticatedGossiper) validateFundingTransaction(_ context.Context, // Before we can add the channel to the channel graph, we need to obtain // the full funding outpoint that's encoded within the channel ID. fundingTx, err := lnwallet.FetchFundingTxWrapper( - d.cfg.ChainIO, &scid, d.quit, + d.cfg.ChainIO, scid, d.quit, ) if err != nil { //nolint:ll diff --git a/lnwallet/interface.go b/lnwallet/interface.go index 9255c513e..f5a717d3f 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -760,7 +760,7 @@ func SupportedWallets() []string { // FetchFundingTxWrapper is a wrapper around FetchFundingTx, except that it will // exit when the supplied quit channel is closed. -func FetchFundingTxWrapper(chain BlockChainIO, chanID *lnwire.ShortChannelID, +func FetchFundingTxWrapper(chain BlockChainIO, chanID lnwire.ShortChannelID, quit chan struct{}) (*wire.MsgTx, error) { txChan := make(chan *wire.MsgTx, 1) @@ -795,7 +795,7 @@ func FetchFundingTxWrapper(chain BlockChainIO, chanID *lnwire.ShortChannelID, // TODO(roasbeef): replace with call to GetBlockTransaction? (would allow to // later use getblocktxn). func FetchFundingTx(chain BlockChainIO, - chanID *lnwire.ShortChannelID) (*wire.MsgTx, error) { + chanID lnwire.ShortChannelID) (*wire.MsgTx, error) { // First fetch the block hash by the block number encoded, then use // that hash to fetch the block itself. @@ -826,7 +826,7 @@ func FetchFundingTx(chain BlockChainIO, // FetchPKScriptWithQuit fetches the output script for the given SCID and exits // early with an error if the provided quit channel is closed before // completion. -func FetchPKScriptWithQuit(chain BlockChainIO, chanID *lnwire.ShortChannelID, +func FetchPKScriptWithQuit(chain BlockChainIO, chanID lnwire.ShortChannelID, quit chan struct{}) ([]byte, error) { tx, err := FetchFundingTxWrapper(chain, chanID, quit) @@ -835,7 +835,7 @@ func FetchPKScriptWithQuit(chain BlockChainIO, chanID *lnwire.ShortChannelID, } outputLocator := chanvalidate.ShortChanIDChanLocator{ - ID: *chanID, + ID: chanID, } output, _, err := outputLocator.Locate(tx) diff --git a/netann/channel_announcement.go b/netann/channel_announcement.go index 3f3e94a39..d5c20052d 100644 --- a/netann/channel_announcement.go +++ b/netann/channel_announcement.go @@ -104,7 +104,7 @@ func CreateChanAnnouncement(chanProof *models.ChannelAuthProof, // FetchPkScript defines a function that can be used to fetch the output script // for the transaction with the given SCID. -type FetchPkScript func(*lnwire.ShortChannelID) ([]byte, error) +type FetchPkScript func(lnwire.ShortChannelID) ([]byte, error) // ValidateChannelAnn validates the channel announcement. func ValidateChannelAnn(a lnwire.ChannelAnnouncement, @@ -249,7 +249,7 @@ func validateChannelAnn2(a *lnwire.ChannelAnnouncement2, // If bitcoin keys are not provided, then we need to get the // on-chain output key since this will be the 3rd key in the // 3-of-3 MuSig2 signature. - pkScript, err := fetchPkScript(&a.ShortChannelID.Val) + pkScript, err := fetchPkScript(a.ShortChannelID.Val) if err != nil { return err } diff --git a/netann/channel_announcement_test.go b/netann/channel_announcement_test.go index a4c1f53ce..390a71642 100644 --- a/netann/channel_announcement_test.go +++ b/netann/channel_announcement_test.go @@ -223,7 +223,7 @@ func test3of3MuSig2ChanAnnouncement(t *testing.T) { // We'll pass in a mock tx fetcher that will return the funding output // containing this key. This is needed since the output key can not be // determined from the channel announcement itself. - fetchTx := func(chanID *lnwire.ShortChannelID) ([]byte, error) { + fetchTx := func(_ lnwire.ShortChannelID) ([]byte, error) { return pkScript, nil }