mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-22 15:44:20 +01:00
noise: Do not expect TlvPayloads without checking
Suggested-by: @darosior
This commit is contained in:
@@ -152,6 +152,10 @@ def recvmsg(plugin, request, last_id=None, **kwargs):
|
||||
@plugin.hook('htlc_accepted')
|
||||
def on_htlc_accepted(onion, htlc, plugin, **kwargs):
|
||||
payload = OnionPayload.from_hex(onion['payload'])
|
||||
if not isinstance(payload, TlvPayload):
|
||||
plugin.log("Payload is not a TLV payload")
|
||||
return {'result': 'continue'}
|
||||
|
||||
|
||||
msg = Message(
|
||||
id=len(plugin.messages),
|
||||
|
||||
Reference in New Issue
Block a user