mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-31 10:10:31 +02:00
funding: stop naming commit types chanType
negotiateCommitmentType returns both a chanType and a commitType, so it is really confusing when the commitType is called chanType instead.
This commit is contained in:
parent
ec85b5be72
commit
e59cd7f91d
@ -38,10 +38,10 @@ func negotiateCommitmentType(desiredChanType *lnwire.ChannelType, local,
|
||||
local, remote, lnwire.ExplicitChannelTypeOptional,
|
||||
) {
|
||||
|
||||
chanType, err := explicitNegotiateCommitmentType(
|
||||
commitType, err := explicitNegotiateCommitmentType(
|
||||
*desiredChanType, local, remote,
|
||||
)
|
||||
return true, desiredChanType, chanType, err
|
||||
return true, desiredChanType, commitType, err
|
||||
}
|
||||
|
||||
// If we're the funder, and we are attempting to use an
|
||||
|
@ -1883,14 +1883,14 @@ func (f *Manager) handleFundingAccept(peer lnpeer.Peer,
|
||||
// channel type in the accept_channel response if we didn't
|
||||
// explicitly set it in the open_channel message. For now, let's
|
||||
// just log the problem instead of failing the funding flow.
|
||||
_, implicitChannelType := implicitNegotiateCommitmentType(
|
||||
_, implicitCommitType := implicitNegotiateCommitmentType(
|
||||
peer.LocalFeatures(), peer.RemoteFeatures(),
|
||||
)
|
||||
|
||||
// We pass in false here as the funder since at this point, we
|
||||
// didn't set a chan type ourselves, so falling back to
|
||||
// implicit funding is acceptable.
|
||||
_, _, negotiatedChannelType, err := negotiateCommitmentType(
|
||||
_, _, negotiatedCommitType, err := negotiateCommitmentType(
|
||||
msg.ChannelType, peer.LocalFeatures(),
|
||||
peer.RemoteFeatures(), false,
|
||||
)
|
||||
@ -1904,7 +1904,7 @@ func (f *Manager) handleFundingAccept(peer lnpeer.Peer,
|
||||
// didn't send one in the first place, we check that it's the
|
||||
// same type we'd have arrived through implicit negotiation. If
|
||||
// it's another type, we fail the flow.
|
||||
if implicitChannelType != negotiatedChannelType {
|
||||
if implicitCommitType != negotiatedCommitType {
|
||||
err := errors.New("negotiated unexpected channel type")
|
||||
f.failFundingFlow(peer, msg.PendingChannelID, err)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user