Skip to content

Commit b9bbc1c

Browse files
committed
rpcserver: return correct policy
Due to (probably) a copy/paste error, we returned the wrong policy for an invoice. We didn't notice this because in our integration tests we never set non-default routing policies.
1 parent 074096d commit b9bbc1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rpcserver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8553,8 +8553,10 @@ func (r *rpcServer) getInboundPolicy(ctx context.Context, chanID uint64,
85538553
return nil, fmt.Errorf("unable to fetch channel: %w", err)
85548554
}
85558555

8556+
// We want the policy that corresponds to the node that is the remote
8557+
// peer in the channel.
85568558
policy := edge.Node2Policy
8557-
if edge.Node2Pub == remotePubStr {
8559+
if edge.Node1Pub == remotePubStr {
85588560
policy = edge.Node1Policy
85598561
}
85608562

0 commit comments

Comments
 (0)