From cf5fe6fde32a63afeda9bcc12d82ad88c6b51b90 Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Mon, 4 Dec 2023 21:51:55 +0100 Subject: [PATCH] relative cltv expiry can be negative --- cln_plugin/cln_messages.go | 2 +- cln_plugin/proto/cln_plugin.pb.go | 8 +++++--- cln_plugin/proto/cln_plugin.proto | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cln_plugin/cln_messages.go b/cln_plugin/cln_messages.go index b2bffe8..7f73c02 100644 --- a/cln_plugin/cln_messages.go +++ b/cln_plugin/cln_messages.go @@ -107,7 +107,7 @@ type Htlc struct { Id uint64 `json:"id"` AmountMsat uint64 `json:"amount_msat"` CltvExpiry uint32 `json:"cltv_expiry"` - CltvExpiryRelative uint32 `json:"cltv_expiry_relative"` + CltvExpiryRelative int32 `json:"cltv_expiry_relative"` PaymentHash string `json:"payment_hash"` } diff --git a/cln_plugin/proto/cln_plugin.pb.go b/cln_plugin/proto/cln_plugin.pb.go index 5f3755f..0756afa 100644 --- a/cln_plugin/proto/cln_plugin.pb.go +++ b/cln_plugin/proto/cln_plugin.pb.go @@ -187,7 +187,7 @@ type Htlc struct { Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` AmountMsat uint64 `protobuf:"varint,3,opt,name=amount_msat,json=amountMsat,proto3" json:"amount_msat,omitempty"` CltvExpiry uint32 `protobuf:"varint,4,opt,name=cltv_expiry,json=cltvExpiry,proto3" json:"cltv_expiry,omitempty"` - CltvExpiryRelative uint32 `protobuf:"varint,5,opt,name=cltv_expiry_relative,json=cltvExpiryRelative,proto3" json:"cltv_expiry_relative,omitempty"` + CltvExpiryRelative int32 `protobuf:"varint,5,opt,name=cltv_expiry_relative,json=cltvExpiryRelative,proto3" json:"cltv_expiry_relative,omitempty"` PaymentHash string `protobuf:"bytes,6,opt,name=payment_hash,json=paymentHash,proto3" json:"payment_hash,omitempty"` } @@ -251,7 +251,7 @@ func (x *Htlc) GetCltvExpiry() uint32 { return 0 } -func (x *Htlc) GetCltvExpiryRelative() uint32 { +func (x *Htlc) GetCltvExpiryRelative() int32 { if x != nil { return x.CltvExpiryRelative } @@ -272,6 +272,7 @@ type HtlcResolution struct { Correlationid string `protobuf:"bytes,1,opt,name=correlationid,proto3" json:"correlationid,omitempty"` // Types that are assignable to Outcome: + // // *HtlcResolution_Fail // *HtlcResolution_Continue // *HtlcResolution_Resolve @@ -428,6 +429,7 @@ type HtlcFail struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Failure: + // // *HtlcFail_FailureMessage // *HtlcFail_FailureOnion Failure isHtlcFail_Failure `protobuf_oneof:"failure"` @@ -679,7 +681,7 @@ var file_cln_plugin_proto_rawDesc = []byte{ 0x74, 0x76, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x6c, 0x74, 0x76, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6c, 0x74, 0x76, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x63, 0x6c, 0x74, 0x76, 0x45, + 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x63, 0x6c, 0x74, 0x76, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, diff --git a/cln_plugin/proto/cln_plugin.proto b/cln_plugin/proto/cln_plugin.proto index 584f60f..a42bdce 100644 --- a/cln_plugin/proto/cln_plugin.proto +++ b/cln_plugin/proto/cln_plugin.proto @@ -27,7 +27,7 @@ message Htlc { uint64 id = 2; uint64 amount_msat = 3; uint32 cltv_expiry = 4; - uint32 cltv_expiry_relative = 5; + int32 cltv_expiry_relative = 5; string payment_hash = 6; }