Corrects tx insertion to statement cache.

This commit is contained in:
PhilipWafula 2021-11-22 19:52:20 +03:00
parent 5f064bf713
commit 7aa2565a3f
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7

View File

@ -47,7 +47,8 @@ def cache_statement(parsed_transaction: dict, querying_party: str):
statement_transactions = [] statement_transactions = []
if cached_statement: if cached_statement:
statement_transactions = json.loads(cached_statement) statement_transactions = json.loads(cached_statement)
statement_transactions.append(parsed_transaction) if parsed_transaction not in statement_transactions:
statement_transactions.append(parsed_transaction)
data = json.dumps(statement_transactions) data = json.dumps(statement_transactions)
identifier = bytes.fromhex(querying_party) identifier = bytes.fromhex(querying_party)
key = cache_data_key(identifier, MetadataPointer.STATEMENT) key = cache_data_key(identifier, MetadataPointer.STATEMENT)