mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-22 22:44:25 +01:00
keysend: Add error when trying to send to self
There is little point in faking a self-payment, but we should also not crash :-) Fixes #4438 Changelog-Fixed: keysend: Keysend returns an error when a self-payment is requested
This commit is contained in:
committed by
Rusty Russell
parent
3a031bf0e3
commit
6cfb72ea1b
@@ -3030,6 +3030,10 @@ def test_keysend(node_factory):
|
||||
features = l1.rpc.listnodes(l4.info['id'])['nodes'][0]['features']
|
||||
assert(int(features, 16) >> 55 & 0x01 == 0)
|
||||
|
||||
# Self-sends are not allowed (see #4438)
|
||||
with pytest.raises(RpcError, match=r'We are the destination.'):
|
||||
l1.rpc.keysend(l1.info['id'], amt)
|
||||
|
||||
# Send an indirect one from l1 to l3
|
||||
l1.rpc.keysend(l3.info['id'], amt)
|
||||
invs = l3.rpc.listinvoices()['invoices']
|
||||
|
||||
Reference in New Issue
Block a user