From b257b8960ba66673d267952e3a90f6ce313b3ee3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 31 Oct 2017 12:36:36 +1030 Subject: [PATCH] test_lightning.py: more debugging for the tx decoding fail under travis. Signed-off-by: Rusty Russell --- tests/test_lightningd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index ce020f459..452e32495 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -239,13 +239,15 @@ class LightningDTests(BaseLightningDTests): l2.daemon.wait_for_log('-> CHANNELD_NORMAL') # Hacky way to find our output. - decoded=bitcoind.rpc.decoderawtransaction(tx)['vout'] - for out in decoded: + decoded=bitcoind.rpc.decoderawtransaction(tx) + for out in decoded['vout']: # Sometimes a float? Sometimes a decimal? WTF Python?! if out['scriptPubKey']['type'] == 'witness_v0_scripthash': if out['value'] == Decimal(amount) / 10**8 or out['value'] * 10**8 == amount: return "{}:1:{}".format(bitcoind.rpc.getblockcount(), out['n']) - raise ValueError("Can't find {} payment in {} ({})".format(amount, tx, decoded)) + # Intermittant decoding failure. See if it decodes badly twice? + decoded2=bitcoind.rpc.decoderawtransaction(tx) + raise ValueError("Can't find {} payment in {} (1={} 2={})".format(amount, tx, decoded, decoded2)) def pay(self, lsrc, ldst, amt, label=None, async=False): if not label: