From 0de838c40fa313d9f4651bf56cd33b1f6c053558 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 25 May 2016 14:41:01 +0200 Subject: [PATCH] simplify query --- bigchaindb/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigchaindb/core.py b/bigchaindb/core.py index b5d26e18..2e9bac8a 100644 --- a/bigchaindb/core.py +++ b/bigchaindb/core.py @@ -167,8 +167,8 @@ class Bigchain(object): break # Query the transaction in the target block and return - response = r.table('bigchain').filter(lambda block: block['id'] == target_block_id).nth(0)\ - .get_field('block').get_field('transactions').filter(lambda tx: tx['id'] == txid).run(self.conn) + response = r.table('bigchain').get(target_block_id).get_field('block')\ + .get_field('transactions').filter(lambda tx: tx['id'] == txid).run(self.conn) return response[0]