lnwallet+htlcswitch: remove the redundant param in OweCommitment

This commit removes the bool param found in OweCommitment, which we
only ever use `true`.
This commit is contained in:
yyforyongyu
2022-03-20 00:59:19 +08:00
parent fea97699ec
commit acde626ac9
2 changed files with 5 additions and 5 deletions

View File

@@ -1882,7 +1882,7 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
// If both commitment chains are fully synced from our PoV, // If both commitment chains are fully synced from our PoV,
// then we don't need to reply with a signature as both sides // then we don't need to reply with a signature as both sides
// already have a commitment with the latest accepted. // already have a commitment with the latest accepted.
if !l.channel.OweCommitment(true) { if !l.channel.OweCommitment() {
return return
} }
@@ -1967,7 +1967,7 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
// processRemoteAdds. Also in case there are no local updates, // processRemoteAdds. Also in case there are no local updates,
// but there are still remote updates that are not in the remote // but there are still remote updates that are not in the remote
// commit tx yet, send out an update. // commit tx yet, send out an update.
if l.channel.OweCommitment(true) { if l.channel.OweCommitment() {
if !l.updateCommitTxOrFail() { if !l.updateCommitTxOrFail() {
return return
} }

View File

@@ -3825,7 +3825,7 @@ func (lc *LightningChannel) ProcessChanSyncMsg(
// but died before the signature was sent. We re-transmit our // but died before the signature was sent. We re-transmit our
// revocation, but also initiate a state transition to re-sync // revocation, but also initiate a state transition to re-sync
// them. // them.
if lc.OweCommitment(true) { if lc.OweCommitment() {
commitSig, htlcSigs, _, err := lc.SignNextCommitment() commitSig, htlcSigs, _, err := lc.SignNextCommitment()
switch { switch {
@@ -4539,11 +4539,11 @@ func (lc *LightningChannel) IsChannelClean() bool {
// out a commitment signature because there are outstanding local updates and/or // out a commitment signature because there are outstanding local updates and/or
// updates in the local commit tx that aren't reflected in the remote commit tx // updates in the local commit tx that aren't reflected in the remote commit tx
// yet. // yet.
func (lc *LightningChannel) OweCommitment(local bool) bool { func (lc *LightningChannel) OweCommitment() bool {
lc.RLock() lc.RLock()
defer lc.RUnlock() defer lc.RUnlock()
return lc.oweCommitment(local) return lc.oweCommitment(true)
} }
// oweCommitment is the internal version of OweCommitment. This function expects // oweCommitment is the internal version of OweCommitment. This function expects