From 36857a1042cd6339f7ca3ef43be9656d13f63ce9 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Thu, 10 Jan 2019 12:23:56 +0100 Subject: [PATCH] lnwallet/channel: add new PaymentDescriptor type `FeeUpdate` This commit adds a new updateType that can be used for PaymentDescriptors: FeeUpdate. We repurpose the fields of the existing PaymentDescriptor struct such that we can easily re-use the commit/ack logic used for other update types also for fee updates. --- lnwallet/channel.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 6175b36e..bf2fe526 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -165,6 +165,10 @@ const ( // original add entry from the remote party's log after the next state // transition. Settle + + // FeeUpdate is an update type sent by the channel initiator that + // updates the fee rate used when signing the commitment transaction. + FeeUpdate ) // String returns a human readable string that uniquely identifies the target @@ -179,6 +183,8 @@ func (u updateType) String() string { return "MalformedFail" case Settle: return "Settle" + case FeeUpdate: + return "FeeUpdate" default: return "" } @@ -190,7 +196,7 @@ func (u updateType) String() string { // the original added HTLC. // // TODO(roasbeef): LogEntry interface?? -// * need to separate attrs for cancel/add/settle +// * need to separate attrs for cancel/add/settle/feeupdate type PaymentDescriptor struct { // RHash is the payment hash for this HTLC. The HTLC can be settled iff // the preimage to this hash is presented.