Skip to content
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.3
github.com/lightninglabs/lndclient v0.19.0-7
github.com/lightninglabs/neutrino/cache v1.1.2
github.com/lightninglabs/taproot-assets/taprpc v1.0.6
github.com/lightninglabs/taproot-assets/taprpc v1.0.7
github.com/lightningnetwork/lnd v0.19.0-beta
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
Expand Down
4 changes: 3 additions & 1 deletion rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8553,8 +8553,10 @@ func (r *rpcServer) getInboundPolicy(ctx context.Context, chanID uint64,
return nil, fmt.Errorf("unable to fetch channel: %w", err)
}

// We want the policy that corresponds to the node that is the remote
// peer in the channel.
policy := edge.Node2Policy
if edge.Node2Pub == remotePubStr {
if edge.Node1Pub == remotePubStr {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, the direction of the policy here is relative

policy = edge.Node1Policy
}

Expand Down
10 changes: 8 additions & 2 deletions tapchannel/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,10 @@ func addCommitmentOutputs(chanType channeldb.ChannelType, localChanCfg,

// We've asserted that we have a non-dust BTC balance if we have an
// asset balance before, so we can just check the asset balance here.
if ourAssetBalance > 0 || ourBalance > 0 {
// In case there is no asset balance, and the BTC value is dust, it will
// not be materialized on-chain, and we shouldn't create an allocation
// for it.
if ourAssetBalance > 0 || ourBalance > localChanCfg.DustLimit {
toLocalScript, err := lnwallet.CommitScriptToSelf(
chanType, initiator, keys.ToLocalKey,
keys.RevocationKey, uint32(localChanCfg.CsvDelay),
Expand Down Expand Up @@ -1033,7 +1036,10 @@ func addCommitmentOutputs(chanType channeldb.ChannelType, localChanCfg,
addAllocation(allocation)
}

if theirAssetBalance > 0 || theirBalance > 0 {
// We only create an allocation if there is going to be an on-chain
// output. If this is dust (which is only allowed if there are no assets
// on the output), it will not be materialized on-chain.
if theirAssetBalance > 0 || theirBalance > localChanCfg.DustLimit {
toRemoteScript, _, err := lnwallet.CommitScriptToRemote(
chanType, initiator, keys.ToRemoteKey, leaseExpiry,
lfn.None[txscript.TapLeaf](),
Expand Down
Loading