BOLT12: fetchinvoice refuses to talk to ourselves
Closed this issue · 3 comments
farscapian commented
I'm trying to implement what I call "Explicit Pay-to-Self" in the BOLT12-prism plugin to enable local composability of prisms. I want to follow the same BOLT12 semantics of fetchinvoice
/pay
for offers generated by the same node.
When I run fetchinvoice
with an offer issued by the local node, I get the following output:
./lightning-cli.sh fetchinvoice lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2q36x2um5zcss9awqc39zslj8mzngsyuvfxkrzjk2z5a0wpvjh3ehzcfur8quevrc 100000
{
"code": 205,
"message": "Refusing to talk to ourselves"
}
CLN currently supports paying to a BOLT11 invoice issued by the local node, but I need BOLT12 semantics so I can simply track the static offer in the Prism definition.
farscapian commented
vincenzopalazzo commented
Yep, I have a branch for this and I think I will resurrect when I we are done with the bolt12 update, thanks to remember me :)
rustyrussell commented
This is already fixed in the upcoming release! Here's the test:
def test_offer_selfpay(node_factory):
"""We can fetch an pay our own offer"""
l1 = node_factory.get_node(options={'experimental-offers': None})
offer = l1.rpc.offer(amount='2msat', description='test_offer_path_self')['bolt12']
inv = l1.rpc.fetchinvoice(offer)['invoice']
l1.rpc.pay(inv)