Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

funding: use default forwarding policy if persisted values not found #7613

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/release-notes/release-notes-0.16.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ available](https://github.com/lightningnetwork/lnd/pull/7529).

* [Fix log output](https://github.com/lightningnetwork/lnd/pull/7604).


* [Channels opened with custom fee policies are now able to forward payments
correctly without needing to restart
first](https://github.com/lightningnetwork/lnd/pull/7597).

* [Fix a bug](https://github.com/lightningnetwork/lnd/pull/7613) where the
funding manager would error out if no persisted initial forwarding policy is
found for a channel.

# Contributors (Alphabetical Order)

* ardevd
Expand Down
7 changes: 4 additions & 3 deletions funding/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3729,10 +3729,11 @@ func (f *Manager) newChanAnnouncement(localPubKey,
}

// The caller of newChanAnnouncement is expected to provide the initial
// forwarding policy to be announced. We abort the channel announcement
// if they are not provided.
// forwarding policy to be announced. If no persisted initial policy
// values are found, then we will use the default policy values in the
// channel announcement.
storedFwdingPolicy, err := f.getInitialFwdingPolicy(chanID)
if err != nil {
if err != nil && !errors.Is(err, channeldb.ErrChannelNotFound) {
return nil, errors.Errorf("unable to generate channel "+
"update announcement: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions funding/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3154,7 +3154,7 @@ func TestFundingManagerCustomChannelParameters(t *testing.T) {
t.Fatal("OpenStatusUpdate was not OpenStatusUpdate_ChanPending")
}

// After the funding is sigend and before the channel announcement
// After the funding is signed and before the channel announcement
// we expect Alice and Bob to store their respective fees in the
// database.
forwardingPolicy, err := alice.fundingMgr.getInitialFwdingPolicy(
Expand All @@ -3169,7 +3169,7 @@ func TestFundingManagerCustomChannelParameters(t *testing.T) {
require.NoError(t, err)
require.NoError(t, assertFees(forwardingPolicy, 100, 1000))

// Wait for Alice to published the funding tx to the network.
// Wait for Alice to publish the funding tx to the network.
var fundingTx *wire.MsgTx
select {
case fundingTx = <-alice.publTxChan:
Expand Down