multi: add ability to read warning messages and log on link level

Warning messages are intended to add "softer" failure modes for peers,
so to start with we simply log the warnings sent to us. While we "may"
disconnect from the peer according to the spec, we start with the least
extreme option (which is also not a change in behavior because
previously we'd just log that we received an unknown odd message).
This commit is contained in:
Carla Kirk-Cohen committed 2022-05-16 13:51:31 -04:00
1 parent f5ef4992e0
commit 99828b8ebb
2 files changed
+14

No files matched your search

+7
View File
@@ -1455,6 +1455,10 @@ out:
break out
}
case *lnwire.Warning:
targetChan = msg.ChanID
isLinkUpdate = p.handleError(&msg.Error)
case *lnwire.Error:
targetChan = msg.ChanID
isLinkUpdate = p.handleError(msg)
@@ -1688,6 +1692,9 @@ func messageSummary(msg lnwire.Message) string {
return fmt.Sprintf("chan_id=%v, id=%v, fail_code=%v",
msg.ChanID, msg.ID, msg.FailureCode)
case *lnwire.Warning:
return fmt.Sprintf("%v", msg.Error.Error())
case *lnwire.Error:
return fmt.Sprintf("%v", msg.Error())