diff --git a/tests/utils.py b/tests/utils.py index 5aa6e25b3..9e797fe4d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -495,15 +495,12 @@ class LightningNode(object): l2.daemon.wait_for_logs(['update for channel .* now ACTIVE', 'to CHANNELD_NORMAL']) # Hacky way to find our output. - decoded = self.bitcoin.rpc.decoderawtransaction(tx) + decoded = self.bitcoin.rpc.decoderawtransaction(tx, True) 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: + if out['value'] == Decimal(amount) / 10**8: return "{}:1:{}".format(self.bitcoin.rpc.getblockcount(), out['n']) - # 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)) + raise ValueError("Can't find {} payment in {} (1={} 2={})".format(amount, tx, decoded)) def subd_pid(self, subd): """Get the process id of the given subdaemon, eg channeld or gossipd"""