From e9cecdc3e0fe44155c4935c7221c01ef14e19d85 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Sun, 10 Nov 2024 10:36:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20spore=20cluster=20cell=20and=20spore=20c?= =?UTF-8?q?ell=20may=20exist=20in=20same=20block=20and=20al=E2=80=A6=20(#2?= =?UTF-8?q?277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: spore cluster cell and spore cell may exist in same block and all pending Signed-off-by: Miles Zhang --- app/models/ckb_sync/new_node_data_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ckb_sync/new_node_data_processor.rb b/app/models/ckb_sync/new_node_data_processor.rb index 4d73a77d9..a5f60d51c 100644 --- a/app/models/ckb_sync/new_node_data_processor.rb +++ b/app/models/ckb_sync/new_node_data_processor.rb @@ -646,7 +646,7 @@ def build_udts!(local_block, outputs, outputs_data) binary_hashes = CkbUtils.hexes_to_bins_sql(CkbSync::Api.instance.spore_cluster_code_hashes) spore_cluster_type_ids = TypeScript.where("code_hash IN (#{binary_hashes})").where(hash_type: "data1", args: parsed_spore_cell[:cluster_id]).pluck(:id) if spore_cluster_type_ids.present? - spore_cluster_cell = CellOutput.live.where(type_script_id: spore_cluster_type_ids).last + spore_cluster_cell = CellOutput.where(type_script_id: spore_cluster_type_ids, status: %i[pending live]).last parsed_cluster_data = CkbUtils.parse_spore_cluster_data(spore_cluster_cell.data) nft_token_attr[:full_name] = parsed_cluster_data[:name] end