Skip to content

Commit ad9f741

Browse files
author
ThomasV
committed
peers script: handle missing fields
1 parent d3104a1 commit ad9f741

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/peers

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ results = util.send_request(peers, {'method':'blockchain.headers.subscribe','par
3535

3636
errors = analyze(results).keys()
3737

38-
for n,v in sorted(results.items(), key=lambda x:x[1]['block_height']):
39-
print "%40s"%n, v['block_height'], v['utxo_root'], "error" if n in errors else "ok"
38+
for n,v in sorted(results.items(), key=lambda x:x[1].get('block_height')):
39+
print "%40s"%n, v.get('block_height'), v.get('utxo_root'), "error" if n in errors else "ok"
4040

4141

4242

0 commit comments

Comments
 (0)