def check_for_phase1_utxos(self, utxos, cb=None):
"""Any participant needs to wait for completion of phase 1 through
seeing the utxos on the network. Optionally pass callback for start
of phase2 (redemption phase), else default is state machine tick();
must have signature callback(utxolist).
Triggered on number of confirmations as set by config.
This should be fired by task looptask, which is stopped on success.
"""
result = cs_single().bc_interface.query_utxo_set(utxos,
includeconf=True)
if None in result:
return
for u in result:
if u['confirms'] < self.coinswap_parameters.tx01_confirm_wait:
return
self.loop.stop()
if cb:
cb()
else:
self.sm.tick()
评论列表
文章目录