mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
routing: allow custom dest feature bits in integratedRoutingContext.testPayment
This is a preparatory commit for a new test to ensure that if a node only has the TLV and payment addr feature bits, we don't try to split a payment.
This commit is contained in:
parent
301f1a870e
commit
27c1779757
1 changed files with 11 additions and 3 deletions
|
@ -88,8 +88,16 @@ func (h htlcAttempt) String() string {
|
||||||
|
|
||||||
// testPayment launches a test payment and asserts that it is completed after
|
// testPayment launches a test payment and asserts that it is completed after
|
||||||
// the expected number of attempts.
|
// the expected number of attempts.
|
||||||
func (c *integratedRoutingContext) testPayment(maxParts uint32) ([]htlcAttempt,
|
func (c *integratedRoutingContext) testPayment(maxParts uint32,
|
||||||
error) {
|
destFeatureBits ...lnwire.FeatureBit) ([]htlcAttempt, error) {
|
||||||
|
|
||||||
|
// We start out with the base set of MPP feature bits. If the caller
|
||||||
|
// overrides this set of bits, then we'll use their feature bits
|
||||||
|
// entirely.
|
||||||
|
baseFeatureBits := mppFeatures
|
||||||
|
if len(destFeatureBits) != 0 {
|
||||||
|
baseFeatureBits = lnwire.NewRawFeatureVector(destFeatureBits...)
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
nextPid uint64
|
nextPid uint64
|
||||||
|
@ -136,7 +144,7 @@ func (c *integratedRoutingContext) testPayment(maxParts uint32) ([]htlcAttempt,
|
||||||
FeeLimit: lnwire.MaxMilliSatoshi,
|
FeeLimit: lnwire.MaxMilliSatoshi,
|
||||||
Target: c.target.pubkey,
|
Target: c.target.pubkey,
|
||||||
PaymentAddr: &paymentAddr,
|
PaymentAddr: &paymentAddr,
|
||||||
DestFeatures: lnwire.NewFeatureVector(mppFeatures, nil),
|
DestFeatures: lnwire.NewFeatureVector(baseFeatureBits, nil),
|
||||||
Amount: c.amt,
|
Amount: c.amt,
|
||||||
CltvLimit: math.MaxUint32,
|
CltvLimit: math.MaxUint32,
|
||||||
MaxParts: maxParts,
|
MaxParts: maxParts,
|
||||||
|
|
Loading…
Add table
Reference in a new issue