mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-30 21:42:39 +02:00
htlcswitch: utilize memoryMailBox within link, no longer spawn goroutine to forward in switch
In this commit, we’ve modified the link and the switch to start to use the new mailBox in place of the existing synchronous message send directly into the link’s upstream/downstream channels. With his change, we no longer need to spawn a new goroutine each time an HTLC needs to be forwarded, or a user payment is initiated.
This commit is contained in:
@@ -38,14 +38,22 @@ type InvoiceDatabase interface {
|
||||
// |
|
||||
//
|
||||
type ChannelLink interface {
|
||||
// TODO(roasbeef): modify interface to embed mail boxes?
|
||||
|
||||
// HandleSwitchPacket handles the switch packets. This packets might be
|
||||
// forwarded to us from another channel link in case the htlc update
|
||||
// came from another peer or if the update was created by user
|
||||
// initially.
|
||||
//
|
||||
// NOTE: This function MUST be non-blocking (or block as little as
|
||||
// possible).
|
||||
HandleSwitchPacket(*htlcPacket)
|
||||
|
||||
// HandleChannelUpdate handles the htlc requests as settle/add/fail
|
||||
// which sent to us from remote peer we have a channel with.
|
||||
//
|
||||
// NOTE: This function MUST be non-blocking (or block as little as
|
||||
// possible).
|
||||
HandleChannelUpdate(lnwire.Message)
|
||||
|
||||
// ChanID returns the channel ID for the channel link. The channel ID
|
||||
|
Reference in New Issue
Block a user