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.
This commit is contained in:
Johan T. Halseth 2019-01-10 12:23:56 +01:00
parent a8b2c093aa
commit 36857a1042
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -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 "<unknown type>"
}
@ -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.