mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Debug test_lockup_drain
This commit is contained in:
committed by
neil saitug
parent
1b8a2aba65
commit
f7cdf1dd98
@@ -919,13 +919,16 @@ class LightningNode(object):
|
||||
# This helper sends all money to a peer until even 1 msat can't get through.
|
||||
def drain(self, peer):
|
||||
total = 0
|
||||
msat = 16**9
|
||||
msat = 4294967295 # Max payment size in some configs
|
||||
while msat != 0:
|
||||
try:
|
||||
logging.debug("Drain step with size={}".format(msat))
|
||||
self.pay(peer, msat)
|
||||
total += msat
|
||||
except RpcError:
|
||||
except RpcError as e:
|
||||
logging.debug("Got an exception while draining channel: {}".format(e))
|
||||
msat //= 2
|
||||
logging.debug("Draining complete after sending a total of {}msats".format(total))
|
||||
return total
|
||||
|
||||
# Note: this feeds through the smoother in update_feerate, so changing
|
||||
|
||||
Reference in New Issue
Block a user