mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01: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:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
@@ -167,6 +168,18 @@ func (m *mockPaymentSession) RequestRoute(_, _ lnwire.MilliSatoshi,
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (m *mockPaymentSession) UpdateAdditionalEdge(_ *lnwire.ChannelUpdate,
|
||||
_ *btcec.PublicKey, _ *channeldb.ChannelEdgePolicy) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *mockPaymentSession) GetAdditionalEdgePolicy(_ *btcec.PublicKey,
|
||||
_ uint64) *channeldb.ChannelEdgePolicy {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type mockPayer struct {
|
||||
sendResult chan error
|
||||
paymentResult chan *htlcswitch.PaymentResult
|
||||
|
||||
Reference in New Issue
Block a user