multi: don't leak underlying pointer to LightningChannel.ChannelPoint()

This commit is contained in:
Keagan McClelland
2024-01-29 15:59:51 -05:00
parent e9b3808c29
commit fd1cd315ce
11 changed files with 53 additions and 42 deletions

View File

@@ -268,11 +268,12 @@ func NewChanCloser(cfg ChanCloseCfg, deliveryScript []byte,
idealFeePerKw chainfee.SatPerKWeight, negotiationHeight uint32,
closeReq *htlcswitch.ChanClose, locallyInitiated bool) *ChanCloser {
cid := lnwire.NewChanIDFromOutPoint(cfg.Channel.ChannelPoint())
chanPoint := cfg.Channel.ChannelPoint()
cid := lnwire.NewChanIDFromOutPoint(&chanPoint)
return &ChanCloser{
closeReq: closeReq,
state: closeIdle,
chanPoint: *cfg.Channel.ChannelPoint(),
chanPoint: chanPoint,
cid: cid,
cfg: cfg,
negotiationHeight: negotiationHeight,