mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-01 19:10:59 +02:00
routing: make shardHandler aware of payment session
This commit adds payment session to shardHandler to enable private edge policies being updated in shardHandler. The relevant interface and mock are updated. From now on, upon seeing a ChannelUpdate message, shardHandler will first try to find the target policy in additionalEdges and update it. If nothing found, it will then check the database for edge policy to update.
This commit is contained in:
@ -138,6 +138,19 @@ type PaymentSession interface {
|
||||
// during path finding.
|
||||
RequestRoute(maxAmt, feeLimit lnwire.MilliSatoshi,
|
||||
activeShards, height uint32) (*route.Route, error)
|
||||
|
||||
// UpdateAdditionalEdge takes an additional channel edge policy
|
||||
// (private channels) and applies the update from the message. Returns
|
||||
// a boolean to indicate whether the update has been applied without
|
||||
// error.
|
||||
UpdateAdditionalEdge(msg *lnwire.ChannelUpdate, pubKey *btcec.PublicKey,
|
||||
policy *channeldb.ChannelEdgePolicy) bool
|
||||
|
||||
// GetAdditionalEdgePolicy uses the public key and channel ID to query
|
||||
// the ephemeral channel edge policy for additional edges. Returns a nil
|
||||
// if nothing found.
|
||||
GetAdditionalEdgePolicy(pubKey *btcec.PublicKey,
|
||||
channelID uint64) *channeldb.ChannelEdgePolicy
|
||||
}
|
||||
|
||||
// paymentSession is used during an HTLC routings session to prune the local
|
||||
|
Reference in New Issue
Block a user