Only append tx if it meets the conditions

fixes 
This commit is contained in:
Sylvain Bellemare 2017-03-03 17:43:25 +01:00 committed by Sylvain Bellemare
parent 5be48e6254
commit 3bf49a5ec1

@ -404,14 +404,13 @@ class Bigchain(object):
# check if the owner is in the condition `owners_after`
if len(output['public_keys']) == 1:
if output['condition']['details']['public_key'] == owner:
tx_link = TransactionLink(tx['id'], index)
links.append(TransactionLink(tx['id'], index))
else:
# for transactions with multiple `public_keys` there will be several subfulfillments nested
# in the condition. We need to iterate the subfulfillments to make sure there is a
# subfulfillment for `owner`
if utils.condition_details_has_owner(output['condition']['details'], owner):
tx_link = TransactionLink(tx['id'], index)
links.append(tx_link)
links.append(TransactionLink(tx['id'], index))
return links
def get_owned_ids(self, owner):