lnwallet+lnwire: minor grammatical fixes after UpdateFee merge

This commit is contained in:
Olaoluwa Osuntokun 2017-07-14 17:10:29 -07:00
parent adbbd1e80f
commit 14832d8c09
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 24 additions and 22 deletions

View File

@ -638,12 +638,13 @@ type LightningChannel struct {
// pendingFeeUpdate is set to the fee-per-kw we last sent (if we are // pendingFeeUpdate is set to the fee-per-kw we last sent (if we are
// channel initiator) or received (if non-initiator) in an update fee // channel initiator) or received (if non-initiator) in an update fee
// message, which haven't yet been included in a commitment. // message, which haven't yet been included in a commitment. It will
// It will be nil if no fee update is un-committed. // be nil if no fee update is un-committed.
pendingFeeUpdate *btcutil.Amount pendingFeeUpdate *btcutil.Amount
// pendingAckFeeUpdate is set to the last committed fee update which is // pendingAckFeeUpdate is set to the last committed fee update which is
// not yet ACKed. Set to nil if no such update. // not yet ACKed. This value will be nil if a fee update hasn't been
// initiated.
pendingAckFeeUpdate *btcutil.Amount pendingAckFeeUpdate *btcutil.Amount
// rHashMap is a map with PaymentHashes pointing to their respective // rHashMap is a map with PaymentHashes pointing to their respective
@ -1349,31 +1350,32 @@ func (lc *LightningChannel) fetchCommitmentView(remoteChain bool,
// Initiate feePerKw to the last committed fee for this chain. // Initiate feePerKw to the last committed fee for this chain.
feePerKw := commitChain.tail().feePerKw feePerKw := commitChain.tail().feePerKw
// Check if any fee updates have taken place since that last commitment. // Check if any fee updates have taken place since that last
// commitment.
if lc.channelState.IsInitiator { if lc.channelState.IsInitiator {
switch {
// The case where we sent an update_fee message since our last // We've sent an update_fee message since our last commitment,
// commitment, and now we are signing that one. // and now are now creating a commitment that reflects the new
if remoteChain && lc.pendingFeeUpdate != nil { // fee update.
case remoteChain && lc.pendingFeeUpdate != nil:
feePerKw = *lc.pendingFeeUpdate feePerKw = *lc.pendingFeeUpdate
}
// The case where we committed to a sent fee update, and now we // We've created a new commitment for the remote chain that
// got a commitment that ACKed that update. // includes a fee update, and have not received a commitment
if !remoteChain && lc.pendingAckFeeUpdate != nil { // after the fee update has been ACked.
case !remoteChain && lc.pendingAckFeeUpdate != nil:
feePerKw = *lc.pendingAckFeeUpdate feePerKw = *lc.pendingAckFeeUpdate
} }
} else { } else {
switch {
// We received a fee update since last received commitment, so // We've received a fee update since the last local commitment,
// this received commitment will sign that update. // so we'll include the fee update in the current view.
if !remoteChain && lc.pendingFeeUpdate != nil { case !remoteChain && lc.pendingFeeUpdate != nil:
feePerKw = *lc.pendingFeeUpdate feePerKw = *lc.pendingFeeUpdate
}
// Earlier we received a commitment that signed an earlier fee // Earlier we received a commitment that signed an earlier fee
// update, and now we must ACK that update. // update, and now we must ACK that update.
if remoteChain && lc.pendingAckFeeUpdate != nil { case remoteChain && lc.pendingAckFeeUpdate != nil:
feePerKw = *lc.pendingAckFeeUpdate feePerKw = *lc.pendingAckFeeUpdate
} }
} }

View File

@ -29,8 +29,8 @@ func NewUpdateFee(chanID ChannelID, feePerKw btcutil.Amount) *UpdateFee {
// interface. // interface.
var _ Message = (*UpdateFee)(nil) var _ Message = (*UpdateFee)(nil)
// Decode deserializes a serialized UpdateFee message stored in the // Decode deserializes a serialized UpdateFee message stored in the passed
// passed io.Reader observing the specified protocol version. // io.Reader observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.
func (c *UpdateFee) Decode(r io.Reader, pver uint32) error { func (c *UpdateFee) Decode(r io.Reader, pver uint32) error {
@ -59,8 +59,8 @@ func (c *UpdateFee) MsgType() MessageType {
return MsgUpdateFee return MsgUpdateFee
} }
// MaxPayloadLength returns the maximum allowed payload size for a // MaxPayloadLength returns the maximum allowed payload size for a UpdateFee
// UpdateFee complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.
func (c *UpdateFee) MaxPayloadLength(uint32) uint32 { func (c *UpdateFee) MaxPayloadLength(uint32) uint32 {