createinvoice: make a minimal blinded "path" in bolt12 invoice if none presented.

The "path" is just a message to ourselves.  This meets the minimal
requirement for bolt12 invoices: that there be a blinded path (at
least so we can use the path_id inside in place of "payment_secret").

We expose the method to make this path_id to a common routine: offers
will need this for generating more sophisticated paths.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-11-09 12:57:04 +10:30
committed by Christian Decker
parent a5471a405b
commit 595fbd2a19
9 changed files with 155 additions and 1 deletions

View File

@@ -4665,7 +4665,8 @@ def test_fetchinvoice(node_factory, bitcoind):
l1.rpc.pay(inv1['invoice'])
# We can't pay the other one now.
with pytest.raises(RpcError, match="INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS.*'erring_node': '{}'".format(l3.info['id'])):
# FIXME: Even dummy blinded paths always return WIRE_INVALID_ONION_BLINDING!
with pytest.raises(RpcError, match="INVALID_ONION_BLINDING.*'erring_node': '{}'".format(l3.info['id'])):
l1.rpc.pay(inv2['invoice'])
# We can't reuse the offer, either.