From f139e9564e2f19beb84a8892abf0febb45f7f85e Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 21 Jan 2020 10:59:11 +0100 Subject: [PATCH] fix: [expand btc adress] filter empty addr fields --- bin/lib/btc_ail.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/lib/btc_ail.py b/bin/lib/btc_ail.py index c9f264bb..25beb8a7 100755 --- a/bin/lib/btc_ail.py +++ b/bin/lib/btc_ail.py @@ -34,11 +34,13 @@ def get_bitcoin_info(bitcoin_address, nb_transaction=50): for transaction in jreq['txs']: for input in transaction['inputs']: - if input['prev_out']['addr'] != bitcoin_address: - set_btc_in.add(input['prev_out']['addr']) + if 'addr' in input['prev_out']: + if input['prev_out']['addr'] != bitcoin_address: + set_btc_in.add(input['prev_out']['addr']) for output in transaction['out']: - if output['addr'] != bitcoin_address: - set_btc_out.add(output['addr']) + if 'addr' in output: + if output['addr'] != bitcoin_address: + set_btc_out.add(output['addr']) dict_btc['btc_in'] = filter_btc_seen(set_btc_in) dict_btc['btc_out'] = filter_btc_seen(set_btc_out)