mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-01 02:51:37 +02:00
routing/payment_session: make RequestRoute take max amt, fee limit and
active shards In preparation for doing pathfinding for routes sending a value less than the total payment amount, we let the payment session take the max amount to send and the fee limit as arguments to RequestRoute.
This commit is contained in:
@ -31,6 +31,8 @@ func (e errNoRoute) Error() string {
|
||||
// needed to resume if from any point.
|
||||
type paymentLifecycle struct {
|
||||
router *ChannelRouter
|
||||
totalAmount lnwire.MilliSatoshi
|
||||
feeLimit lnwire.MilliSatoshi
|
||||
paymentHash lntypes.Hash
|
||||
paySession PaymentSession
|
||||
timeoutChan <-chan time.Time
|
||||
@ -267,7 +269,9 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
|
||||
}
|
||||
|
||||
// Create a new payment attempt from the given payment session.
|
||||
rt, err := p.paySession.RequestRoute(uint32(p.currentHeight))
|
||||
rt, err := p.paySession.RequestRoute(
|
||||
p.totalAmount, p.feeLimit, 0, uint32(p.currentHeight),
|
||||
)
|
||||
if err != nil {
|
||||
log.Warnf("Failed to find route for payment %x: %v",
|
||||
p.paymentHash, err)
|
||||
|
Reference in New Issue
Block a user