mirror of
https://github.com/aljazceru/plugins.git
synced 2026-01-11 17:24:20 +01:00
jitrebalance: handle the absence of the 'erring_channel' field
On failed 'sendpay'. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This commit is contained in:
committed by
Christian Decker
parent
18632df38c
commit
386d4eaa6d
@@ -91,10 +91,15 @@ def try_rebalance(scid, chan, amt, peer, request):
|
||||
return
|
||||
except RpcError as e:
|
||||
error = e.error['data']
|
||||
erring_channel = error['erring_channel']
|
||||
erring_direction = error['erring_direction']
|
||||
exclusions.append("{}/{}".format(erring_channel, erring_direction))
|
||||
plugin.log("Excluding {} due to a failed attempt".format(erring_channel))
|
||||
# The erring_channel field can not be present (shouldn't happen) or
|
||||
# can be "0x0x0"
|
||||
erring_channel = error.get('erring_channel', '0x0x0')
|
||||
if erring_channel != '0x0x0':
|
||||
erring_direction = error['erring_direction']
|
||||
exclusions.append("{}/{}".format(erring_channel,
|
||||
erring_direction))
|
||||
plugin.log("Excluding {} due to a failed attempt"
|
||||
.format(erring_channel))
|
||||
|
||||
request.set_result({"result": "continue"})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user