htlcswitch: fix error not checked

As required by the linter.
This commit is contained in:
yyforyongyu committed 2025-07-03 19:50:58 +08:00
1 parent 31e166a6b3
commit 2bb8b90afd
1 file changed
+13 -4
+13 -4
View File
@@ -3918,7 +3918,10 @@ func (l *channelLink) resumeLink(ctx context.Context) error {
// ensure that all acknowledgments that occur during channel // ensure that all acknowledgments that occur during channel
// resynchronization have taken affect, causing us only to pull unacked // resynchronization have taken affect, causing us only to pull unacked
// packets after starting to read from the downstream mailbox. // packets after starting to read from the downstream mailbox.
l.mailBox.ResetPackets() err := l.mailBox.ResetPackets()
if err != nil {
l.log.Errorf("failed to reset packets: %v", err)
}
// If the channel is pending, there's no need to reforwarding packets. // If the channel is pending, there's no need to reforwarding packets.
if l.ShortChanID() == hop.Source { if l.ShortChanID() == hop.Source {
@@ -3931,7 +3934,7 @@ func (l *channelLink) resumeLink(ctx context.Context) error {
// only attempt to resolve packages if our short chan id indicates that // only attempt to resolve packages if our short chan id indicates that
// the channel is not pending, otherwise we should have no htlcs to // the channel is not pending, otherwise we should have no htlcs to
// reforward. // reforward.
err := l.resolveFwdPkgs(ctx) err = l.resolveFwdPkgs(ctx)
switch err { switch err {
// No error was encountered, success. // No error was encountered, success.
case nil: case nil:
@@ -4316,7 +4319,10 @@ func (l *channelLink) processRemoteCommitSig(ctx context.Context,
l.incomingCommitHooks.invoke() l.incomingCommitHooks.invoke()
l.RWMutex.Unlock() l.RWMutex.Unlock()
l.cfg.Peer.SendMessage(false, nextRevocation) err = l.cfg.Peer.SendMessage(false, nextRevocation)
if err != nil {
l.log.Errorf("failed to send RevokeAndAck: %v", err)
}
// Notify the incoming htlcs of which the resolutions were locked in. // Notify the incoming htlcs of which the resolutions were locked in.
for id, settled := range finalHTLCs { for id, settled := range finalHTLCs {
@@ -4601,7 +4607,10 @@ func (l *channelLink) processLocalUpdateFulfillHTLC(ctx context.Context,
// Then we send the HTLC settle message to the connected peer so we can // Then we send the HTLC settle message to the connected peer so we can
// continue the propagation of the settle message. // continue the propagation of the settle message.
l.cfg.Peer.SendMessage(false, htlc) err = l.cfg.Peer.SendMessage(false, htlc)
if err != nil {
l.log.Errorf("failed to send UpdateFulfillHTLC: %v", err)
}
// Send a settle event notification to htlcNotifier. // Send a settle event notification to htlcNotifier.
l.cfg.HtlcNotifier.NotifySettleEvent( l.cfg.HtlcNotifier.NotifySettleEvent(