mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-22 23:54:20 +01:00
noise: Allow malformed onion if it's the last hop
This was counted as a failure before, but it actually means we delivered successfully.
This commit is contained in:
@@ -90,9 +90,9 @@ def deliver(node_id, payload, amt, max_attempts=5, payment_hash=None):
|
|||||||
plugin.rpc.waitsendpay(payment_hash=payment_hash)
|
plugin.rpc.waitsendpay(payment_hash=payment_hash)
|
||||||
return {'route': route, 'payment_hash': payment_hash, 'attempt': attempt}
|
return {'route': route, 'payment_hash': payment_hash, 'attempt': attempt}
|
||||||
except RpcError as e:
|
except RpcError as e:
|
||||||
print(e)
|
|
||||||
failcode = e.error['data']['failcode']
|
failcode = e.error['data']['failcode']
|
||||||
if failcode == 16399:
|
failingidx = e.error['data']['erring_index']
|
||||||
|
if failcode == 16399 or failingidx == len(hops):
|
||||||
return {'route': route, 'payment_hash': payment_hash, 'attempt': attempt+1}
|
return {'route': route, 'payment_hash': payment_hash, 'attempt': attempt+1}
|
||||||
|
|
||||||
plugin.log("Retrying delivery.")
|
plugin.log("Retrying delivery.")
|
||||||
|
|||||||
Reference in New Issue
Block a user