multi: don't leak underlying pointer to LightningChannel.ChannelPoint()
This commit is contained in:
1 parent
e9b3808c29
commit
fd1cd315ce
11 files changed
+53
-42
No files matched your search
@@ -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,
|
||||
|
||||
@@ -146,8 +146,8 @@ type mockChannel struct {
|
||||
remoteKey keychain.KeyDescriptor
|
||||
}
|
||||
|
||||
func (m *mockChannel) ChannelPoint() *wire.OutPoint {
|
||||
return &m.chanPoint
|
||||
func (m *mockChannel) ChannelPoint() wire.OutPoint {
|
||||
return m.chanPoint
|
||||
}
|
||||
|
||||
func (m *mockChannel) MarkCoopBroadcasted(*wire.MsgTx, bool) error {
|
||||
|
||||
@@ -29,7 +29,7 @@ type CoopFeeEstimator interface {
|
||||
// closing process.
|
||||
type Channel interface { //nolint:interfacebloat
|
||||
// ChannelPoint returns the channel point of the target channel.
|
||||
ChannelPoint() *wire.OutPoint
|
||||
ChannelPoint() wire.OutPoint
|
||||
|
||||
// MarkCoopBroadcasted persistently marks that the channel close
|
||||
// transaction has been broadcast.
|
||||
|
||||
Reference in new issue
Block a user