mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
tests/test_pay.py: Add test to replicate #3757.
This commit is contained in:
committed by
Rusty Russell
parent
5db69f1b41
commit
a25af262e9
20
tests/plugins/fail_htlcs_invalid.py
Executable file
20
tests/plugins/fail_htlcs_invalid.py
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pyln.client import Plugin
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.hook("htlc_accepted")
|
||||
def on_htlc_accepted(onion, plugin, **kwargs):
|
||||
plugin.log("Failing htlc on purpose with invalid onion failure")
|
||||
plugin.log("onion: %r" % (onion))
|
||||
# WIRE_TEMPORARY_CHANNEL_FAILURE = 0x1007
|
||||
# This failure code should be followed by a
|
||||
# `channel_update`; we deliberately return
|
||||
# a 0-length `channel_update` to trigger
|
||||
# issue #3757 reported by @sumBTC.
|
||||
return {"result": "fail", "failure_message": "10070000"}
|
||||
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user