@@ -649,3 +649,27 @@ def test_xpay_no_mpp(node_factory, chainparams):
649649 assert ret ['successful_parts' ] == 1
650650 assert ret ['amount_msat' ] == AMOUNT
651651 assert ret ['amount_sent_msat' ] == AMOUNT + AMOUNT // 100000 + 1
652+
653+
654+ def test_xpay_bolt12_no_mpp (node_factory , chainparams ):
655+ """We should not (yet!) avoid mpp if BOLT12 invoice doesn't say we should"""
656+ l1 , l2 , l3 , l4 = node_factory .get_nodes (4 )
657+ node_factory .join_nodes ([l1 , l2 , l3 ], wait_for_announce = True )
658+ node_factory .join_nodes ([l1 , l4 , l3 ], wait_for_announce = True )
659+
660+ # Amount needs to be enought that it bothers splitting, but not
661+ # so much that it can't pay without mpp.
662+ AMOUNT = 500000000
663+
664+ # We create a version of this which doesn't advertize support for MPP
665+ # (I grabbed this from a real instance)
666+ inv = l3 .rpc .createinvoice (invstring = "lni1qqg00rlfqualt5wvj9meezlx202qwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8sspqae4jsqzshw3jhxazl0pcxz72lvfhkcap3xf0kum6ld4c8q93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggrv4a2zv5mfvds5pz9ehe40uws375pc4u6ausees3xuezw7d4kssx6gpr854lme2pqavazfzxk4pgv4pvnamxv7e26787e3zm53kpek3qzmpjx50jc6t625pqae4jspvppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96" ,
667+ preimage = "637f5b64ae540986826288ed24db980e756b2eb680b6db17f1072643c12ae531" ,
668+ label = "b53c2f55f53a0f979df864d36fff53bbf10454130df9bbf478f1727386f6ef93-03657aa1329b4b1b0a0445cdf357f1d08fa81c579aef219cc226e644ef36b6840d-0" )['bolt12' ]
669+
670+ # This will MPP ANYWAY, even though MPP is not specified!
671+ ret = l1 .rpc .xpay (inv )
672+ assert ret ['failed_parts' ] == 0
673+ assert ret ['successful_parts' ] == 2
674+ assert ret ['amount_msat' ] == AMOUNT
675+ assert ret ['amount_sent_msat' ] == AMOUNT + AMOUNT // 100000 + 1
0 commit comments