From 3c702ef4ece8601bb2b9ab439cbc84a2c2d99428 Mon Sep 17 00:00:00 2001 From: David Whittington Date: Thu, 13 Jul 2023 16:50:27 -0500 Subject: [PATCH] refactor(bundles ans-104): use owner address from data item instead of rehashing Prior to this change we were hashing the owner key to get the owner address. This change uses the owner address from the data item instead. These should always be the same value so rehashing is unnecessary. Note: I ran a test comparing the values and on the sample of data items I processed there were no differences. --- src/database/standalone-sqlite.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/standalone-sqlite.ts b/src/database/standalone-sqlite.ts index c3903729..827c8e66 100644 --- a/src/database/standalone-sqlite.ts +++ b/src/database/standalone-sqlite.ts @@ -259,7 +259,7 @@ export function dataItemToDbRows(item: NormalizedDataItem, height?: number) { } const ownerBuffer = fromB64Url(item.owner); - const ownerAddressBuffer = ownerToAddress(ownerBuffer); + const ownerAddressBuffer = fromB64Url(item.owner_address); wallets.push({ address: ownerAddressBuffer, public_modulus: ownerBuffer });