mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
invoice: Check duplicate preimage when explicitly sprcified.
Reported-by: @mcudev
This commit is contained in:
@@ -462,6 +462,12 @@ class LightningDTests(BaseLightningDTests):
|
||||
payment_preimage = payment['payment_preimage']
|
||||
assert invoice_preimage == payment_preimage
|
||||
|
||||
# Creating a new invoice with same preimage should error.
|
||||
self.assertRaisesRegex(ValueError,
|
||||
"preimage already used",
|
||||
l2.rpc.invoice, 123456, 'inv2', '?',
|
||||
None, None, invoice_preimage)
|
||||
|
||||
def test_invoice(self):
|
||||
l1 = self.node_factory.get_node()
|
||||
l2 = self.node_factory.get_node()
|
||||
|
||||
Reference in New Issue
Block a user