lnwire: morph CancelHTLC into UpdateFailHTLC, remove HTLCAddReject
This commit morphs the prior CancelHTLC into the new UpdateFailHTLC message and also gets rid of the obsolete HLTCAddReject message while we’re at it. The primary change from the CancelHTLC message to the UpdateFailHTLC message is that the CancelReason is now simply called Reason and that it’s now an opaque encrypted set of bytes. With this update the failure messages are now more flexible (they can even carry new ChannelUpdate’s) and also don’t reveal the exact cause of failure to intermediate nodes.
This commit is contained in:
6 files changed
+83
-303
No files matched your search
+3
-6
@@ -37,10 +37,9 @@ const (
|
||||
CmdCloseComplete = uint32(310)
|
||||
|
||||
// Commands for negotiating HTLCs.
|
||||
CmdHTLCAddReject = uint32(1020)
|
||||
CmdHTLCSettleRequest = uint32(1100)
|
||||
CmdCancelHTLC = uint32(1300)
|
||||
CmdUpdateAddHTLC = uint32(1000)
|
||||
CmdUpdateFailHTLC = uint32(1020)
|
||||
|
||||
// Commands for modifying commitment transactions.
|
||||
CmdCommitSig = uint32(2000)
|
||||
@@ -106,14 +105,12 @@ func makeEmptyMessage(command uint32) (Message, error) {
|
||||
msg = &CloseRequest{}
|
||||
case CmdCloseComplete:
|
||||
msg = &CloseComplete{}
|
||||
case CmdHTLCAddReject:
|
||||
msg = &HTLCAddReject{}
|
||||
case CmdHTLCSettleRequest:
|
||||
msg = &HTLCSettleRequest{}
|
||||
case CmdCancelHTLC:
|
||||
msg = &CancelHTLC{}
|
||||
case CmdUpdateAddHTLC:
|
||||
msg = &UpdateAddHTLC{}
|
||||
case CmdUpdateFailHTLC:
|
||||
msg = &UpdateFailHTLC{}
|
||||
case CmdCommitSig:
|
||||
msg = &CommitSig{}
|
||||
case CmdRevokeAndAck:
|
||||
|
||||
Reference in new issue
Block a user