mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
test_lightningd.py: more information when we fail to find payment.
Travis has been hitting this intermittantly, can't reproduce here. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
0c7ca9ab7c
commit
2aadd351f8
@@ -237,12 +237,13 @@ class LightningDTests(BaseLightningDTests):
|
|||||||
l2.daemon.wait_for_log('-> CHANNELD_NORMAL')
|
l2.daemon.wait_for_log('-> CHANNELD_NORMAL')
|
||||||
|
|
||||||
# Hacky way to find our output.
|
# Hacky way to find our output.
|
||||||
for out in bitcoind.rpc.decoderawtransaction(tx)['vout']:
|
decoded=bitcoind.rpc.decoderawtransaction(tx)['vout']
|
||||||
|
for out in decoded:
|
||||||
# Sometimes a float? Sometimes a decimal? WTF Python?!
|
# Sometimes a float? Sometimes a decimal? WTF Python?!
|
||||||
if out['scriptPubKey']['type'] == 'witness_v0_scripthash':
|
if out['scriptPubKey']['type'] == 'witness_v0_scripthash':
|
||||||
if out['value'] == Decimal(amount) / 10**8 or out['value'] * 10**8 == amount:
|
if out['value'] == Decimal(amount) / 10**8 or out['value'] * 10**8 == amount:
|
||||||
return "{}:1:{}".format(bitcoind.rpc.getblockcount(), out['n'])
|
return "{}:1:{}".format(bitcoind.rpc.getblockcount(), out['n'])
|
||||||
raise ValueError("Can't find {} payment in {}".format(amount, tx))
|
raise ValueError("Can't find {} payment in {} ({})".format(amount, tx, decoded))
|
||||||
|
|
||||||
def pay(self, lsrc, ldst, amt, label=None, async=False):
|
def pay(self, lsrc, ldst, amt, label=None, async=False):
|
||||||
if not label:
|
if not label:
|
||||||
|
|||||||
Reference in New Issue
Block a user