mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Replace wait_for_channels with an actual check
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
ba31dd2d9d
commit
202ce5e4ea
@@ -459,3 +459,11 @@ class LightningNode(object):
|
||||
# Intermittent decoding failure. See if it decodes badly twice?
|
||||
decoded2 = self.bitcoin.rpc.decoderawtransaction(tx)
|
||||
raise ValueError("Can't find {} payment in {} (1={} 2={})".format(amount, tx, decoded, decoded2))
|
||||
|
||||
def is_channel_active(self, chanid):
|
||||
channels = self.rpc.listchannels()['channels']
|
||||
active = [(c['short_channel_id'], c['flags']) for c in channels if c['active']]
|
||||
return (chanid, 0) in active and (chanid, 1) in active
|
||||
|
||||
def wait_channel_active(self, chanid):
|
||||
wait_for(lambda: self.is_channel_active(chanid), interval=1)
|
||||
|
||||
Reference in New Issue
Block a user