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:
parent
a8b2c093aa
commit
36857a1042
@ -165,6 +165,10 @@ const (
|
|||||||
// original add entry from the remote party's log after the next state
|
// original add entry from the remote party's log after the next state
|
||||||
// transition.
|
// transition.
|
||||||
Settle
|
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
|
// String returns a human readable string that uniquely identifies the target
|
||||||
@ -179,6 +183,8 @@ func (u updateType) String() string {
|
|||||||
return "MalformedFail"
|
return "MalformedFail"
|
||||||
case Settle:
|
case Settle:
|
||||||
return "Settle"
|
return "Settle"
|
||||||
|
case FeeUpdate:
|
||||||
|
return "FeeUpdate"
|
||||||
default:
|
default:
|
||||||
return "<unknown type>"
|
return "<unknown type>"
|
||||||
}
|
}
|
||||||
@ -190,7 +196,7 @@ func (u updateType) String() string {
|
|||||||
// the original added HTLC.
|
// the original added HTLC.
|
||||||
//
|
//
|
||||||
// TODO(roasbeef): LogEntry interface??
|
// TODO(roasbeef): LogEntry interface??
|
||||||
// * need to separate attrs for cancel/add/settle
|
// * need to separate attrs for cancel/add/settle/feeupdate
|
||||||
type PaymentDescriptor struct {
|
type PaymentDescriptor struct {
|
||||||
// RHash is the payment hash for this HTLC. The HTLC can be settled iff
|
// RHash is the payment hash for this HTLC. The HTLC can be settled iff
|
||||||
// the preimage to this hash is presented.
|
// the preimage to this hash is presented.
|
||||||
|
Loading…
Reference in New Issue
Block a user