• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lnwallet/chancloser/rbf_coop_msg_mapper.go
1
package chancloser
2

3
import (
4
        "github.com/lightningnetwork/lnd/fn/v2"
5
        "github.com/lightningnetwork/lnd/lnwire"
6
)
7

8
// RbfMsgMapper is a struct that implements the MsgMapper interface for the
9
// rbf-coop close state machine. This enables the state machine to be used with
10
// protofsm.
11
type RbfMsgMapper struct {
12
        // blockHeight is the height of the block when the co-op close request
13
        // was initiated. This is used to validate conditions related to the
14
        // thaw height.
15
        blockHeight uint32
16

17
        // chanID is the channel ID of the channel being closed.
18
        chanID lnwire.ChannelID
19
}
20

21
// NewRbfMsgMapper creates a new RbfMsgMapper instance given the current block
22
// height when the co-op close request was initiated.
23
func NewRbfMsgMapper(blockHeight uint32,
24
        chanID lnwire.ChannelID) *RbfMsgMapper {
×
25

×
26
        return &RbfMsgMapper{
×
27
                blockHeight: blockHeight,
×
28
                chanID:      chanID,
×
29
        }
×
30
}
×
31

32
// someEvent returns the target type as a protocol event option.
33
func someEvent[T ProtocolEvent](m T) fn.Option[ProtocolEvent] {
×
34
        return fn.Some(ProtocolEvent(m))
×
35
}
×
36

37
// isExpectedChanID returns true if the channel ID of the message matches the
38
// bound instance.
39
func (r *RbfMsgMapper) isExpectedChanID(chanID lnwire.ChannelID) bool {
×
40
        return r.chanID == chanID
×
41
}
×
42

43
// MapMsg maps a wire message into a FSM event. If the message is not mappable,
44
// then an error is returned.
45
func (r *RbfMsgMapper) MapMsg(wireMsg lnwire.Message) fn.Option[ProtocolEvent] {
×
46
        switch msg := wireMsg.(type) {
×
47
        case *lnwire.Shutdown:
×
48
                if !r.isExpectedChanID(msg.ChannelID) {
×
49
                        return fn.None[ProtocolEvent]()
×
50
                }
×
51

52
                return someEvent(&ShutdownReceived{
×
53
                        BlockHeight:    r.blockHeight,
×
54
                        ShutdownScript: msg.Address,
×
55
                })
×
56

57
        case *lnwire.ClosingComplete:
×
58
                if !r.isExpectedChanID(msg.ChannelID) {
×
59
                        return fn.None[ProtocolEvent]()
×
60
                }
×
61

62
                return someEvent(&OfferReceivedEvent{
×
63
                        SigMsg: *msg,
×
64
                })
×
65

66
        case *lnwire.ClosingSig:
×
67
                if !r.isExpectedChanID(msg.ChannelID) {
×
68
                        return fn.None[ProtocolEvent]()
×
69
                }
×
70

71
                return someEvent(&LocalSigReceived{
×
72
                        SigMsg: *msg,
×
73
                })
×
74
        }
75

76
        return fn.None[ProtocolEvent]()
×
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc