routing: add capacity to special edges

Having a capacity available is important for liquidity estimation.

* We add a dummy capacity to hop hints. Hop hints specify neither the
  capacity nor a maxHTLC size, which is why we assume the channel to
  have a high capacity relative to the amount we send.

* We add a capacity to local edges. These channels should always have a
  capacity associated with them, even in the neutrino case (a fallback
  to maxHTLC is not necessary). This is just for completeness, as the
  probability calculation for local channels is done separately.
This commit is contained in:
bitromortac
2023-03-15 16:30:50 +01:00
parent b6d65752f7
commit 7df1482cfc
3 changed files with 25 additions and 5 deletions

View File

@@ -218,7 +218,10 @@ func (u *edgeUnifier) getEdgeLocal(amt lnwire.MilliSatoshi,
maxBandwidth = bandwidth
// Update best edge.
bestEdge = &unifiedEdge{policy: edge.policy}
bestEdge = &unifiedEdge{
policy: edge.policy,
capacity: edge.capacity,
}
}
return bestEdge