diff --git a/app/models/ckb_sync/new_node_data_processor.rb b/app/models/ckb_sync/new_node_data_processor.rb index da6360772..57cfcc062 100644 --- a/app/models/ckb_sync/new_node_data_processor.rb +++ b/app/models/ckb_sync/new_node_data_processor.rb @@ -782,7 +782,7 @@ def build_cells_and_locks!( if contract temp_hash = temp_hash.merge is_contract: true, contract_id: contract.id else - contract = Contract.create code_hash: lock_script.code_hash + contract = Contract.create code_hash: lock_script.script_hash temp_hash = temp_hash.merge contract_id: contract.id end script = Script.find_or_create_by temp_hash @@ -796,7 +796,7 @@ def build_cells_and_locks!( type_script_ids.each do |type_script_id| type_script = TypeScript.find(type_script_id) temp_hash = { script_hash: type_script&.script_hash, is_contract: false } - contract = Contract.find_by code_hash: type_script.script_hash + contract = Contract.find_by code_hash: type_script.code_hash if contract temp_hash = temp_hash.merge is_contract: true, contract_id: contract.id