htlcswitch: pass quit chans as unidirectional
This is a requirement for replacing the quit channel with a Context. The Done() channel of a Context is always recv-only, so all users of that channel must not expect a bidirectional channel.
This commit is contained in:
1 parent
48567e8944
commit
cd14c52ecd
7 files changed
+45
-33
No files matched your search
@@ -95,7 +95,7 @@ type InterceptableSwitch struct {
|
||||
|
||||
type interceptedPackets struct {
|
||||
packets []*htlcPacket
|
||||
linkQuit chan struct{}
|
||||
linkQuit <-chan struct{}
|
||||
isReplay bool
|
||||
}
|
||||
|
||||
@@ -465,8 +465,8 @@ func (s *InterceptableSwitch) Resolve(res *FwdResolution) error {
|
||||
// interceptor. If the interceptor signals the resume action, the htlcs are
|
||||
// forwarded to the switch. The link's quit signal should be provided to allow
|
||||
// cancellation of forwarding during link shutdown.
|
||||
func (s *InterceptableSwitch) ForwardPackets(linkQuit chan struct{}, isReplay bool,
|
||||
packets ...*htlcPacket) error {
|
||||
func (s *InterceptableSwitch) ForwardPackets(linkQuit <-chan struct{},
|
||||
isReplay bool, packets ...*htlcPacket) error {
|
||||
|
||||
// Synchronize with the main event loop. This should be light in the
|
||||
// case where there is no interceptor.
|
||||
|
||||
Reference in new issue
Block a user