multi: make NewChanIDFromOutpoint accept value instead of pointer

This commit is contained in:
Keagan McClelland
2024-01-29 16:19:15 -05:00
parent fd1cd315ce
commit db39a905cb
27 changed files with 108 additions and 106 deletions

View File

@@ -40,7 +40,7 @@ func (c ChannelID) String() string {
// usable within the network. In order to convert the OutPoint into a ChannelID,
// we XOR the lower 2-bytes of the txid within the OutPoint with the big-endian
// serialization of the Index of the OutPoint, truncated to 2-bytes.
func NewChanIDFromOutPoint(op *wire.OutPoint) ChannelID {
func NewChanIDFromOutPoint(op wire.OutPoint) ChannelID {
// First we'll copy the txid of the outpoint into our channel ID slice.
var cid ChannelID
copy(cid[:], op.Hash[:])
@@ -85,7 +85,7 @@ func (c *ChannelID) GenPossibleOutPoints() [MaxFundingTxOutputs]wire.OutPoint {
// IsChanPoint returns true if the OutPoint passed corresponds to the target
// ChannelID.
func (c ChannelID) IsChanPoint(op *wire.OutPoint) bool {
candidateCid := NewChanIDFromOutPoint(op)
candidateCid := NewChanIDFromOutPoint(*op)
return candidateCid == c
}