@@ -32,6 +32,7 @@ def process_block(node_block)
3232 local_block . ckb_transactions_count = ckb_transactions . size
3333 local_block . live_cell_changes = ckb_transactions . sum ( &:live_cell_changes )
3434 CkbTransaction . import! ( ckb_transactions , recursive : true , batch_size : 3500 , validate : false )
35+ update_pool_tx_status ( ckb_transactions )
3536 input_capacities = ckb_transactions . reject ( &:is_cellbase ) . pluck ( :id ) . to_h { |id | [ id , [ ] ] }
3637 update_tx_fee_related_data ( local_block , input_capacities , udt_infos )
3738 calculate_tx_fee ( local_block , ckb_transactions , input_capacities , outputs . group_by ( &:ckb_transaction_id ) )
@@ -53,6 +54,10 @@ def process_block(node_block)
5354
5455 private
5556
57+ def update_pool_tx_status ( ckb_transactions )
58+ PoolTransactionEntry . pool_transaction_pending . where ( tx_hash : ckb_transactions . pluck ( :tx_hash ) ) . update_all ( tx_status : "committed" )
59+ end
60+
5661 def increase_records_count ( ckb_transactions )
5762 block_counter = TableRecordCount . find_by ( table_name : "blocks" )
5863 block_counter . increment! ( :count )
@@ -89,7 +94,7 @@ def update_udt_accounts(udt_infos, block_timestamp)
8994 if udt_account . present?
9095 udt_account . update! ( amount : amount )
9196 else
92- udt = Udt . find_or_create_by! ( type_hash : type_hash , code_hash : ENV [ "SUDT_CELL_TYPE_HASH" ] , udt_type : "sudt" )
97+ udt = Udt . find_or_create_by! ( type_hash : type_hash , udt_type : "sudt" )
9398 udt . update ( block_timestamp : block_timestamp ) if udt . block_timestamp . blank?
9499 if udt . issuer_address . blank?
95100 issuer_address = Address . where ( lock_hash : udt_type_script . args ) . pick ( :address_hash )
@@ -497,7 +502,7 @@ def build_cell_outputs(node_outputs, ckb_transaction, addresses, outputs_data, o
497502 if cell_output . udt?
498503 udt_infos << { type_script : output . type , address : address }
499504 tags << "udt"
500- udt = Udt . find_or_create_by! ( type_hash : output . type . compute_hash , code_hash : ENV [ "SUDT_CELL_TYPE_HASH" ] , udt_type : "sudt" )
505+ udt = Udt . find_or_create_by! ( type_hash : output . type . compute_hash , udt_type : "sudt" )
501506 udt_ids << udt . id
502507 udt_address_ids << address . id
503508 end
@@ -540,7 +545,7 @@ def build_withdraw_dao_events(address_id, ckb_transaction_id, local_block, previ
540545 end
541546
542547 def cell_type ( type_script , output_data )
543- return "normal" unless [ ENV [ "DAO_CODE_HASH" ] , ENV [ "DAO_TYPE_HASH" ] , ENV [ "SUDT_CELL_TYPE_HASH" ] ] . include? ( type_script &.code_hash )
548+ return "normal" unless [ ENV [ "DAO_CODE_HASH" ] , ENV [ "DAO_TYPE_HASH" ] , ENV [ "SUDT_CELL_TYPE_HASH" ] , ENV [ "SUDT1_CELL_TYPE_HASH" ] ] . include? ( type_script &.code_hash )
544549
545550 case type_script &.code_hash
546551 when ENV [ "DAO_CODE_HASH" ] , ENV [ "DAO_TYPE_HASH" ]
@@ -549,7 +554,7 @@ def cell_type(type_script, output_data)
549554 else
550555 "nervos_dao_withdrawing"
551556 end
552- when ENV [ "SUDT_CELL_TYPE_HASH" ]
557+ when ENV [ "SUDT_CELL_TYPE_HASH" ] , ENV [ "SUDT1_CELL_TYPE_HASH" ]
553558 if CKB ::Utils . hex_to_bin ( output_data ) . bytesize >= CellOutput ::MIN_SUDT_AMOUNT_BYTESIZE
554559 "udt"
555560 else
@@ -676,7 +681,7 @@ def update_ckb_transaction(consumed_tx, address_id, previous_cell_output, update
676681 consumed_tx . contained_address_ids << address_id
677682 if previous_cell_output . udt?
678683 consumed_tx . tags << "udt"
679- consumed_tx . contained_udt_ids << Udt . find_or_create_by! ( type_hash : previous_cell_output . type_hash , code_hash : ENV [ "SUDT_CELL_TYPE_HASH" ] , udt_type : "sudt" ) . id
684+ consumed_tx . contained_udt_ids << Udt . find_or_create_by! ( type_hash : previous_cell_output . type_hash , udt_type : "sudt" ) . id
680685 consumed_tx . udt_address_ids << previous_cell_output . address_id
681686 end
682687 if previous_cell_output . nervos_dao_withdrawing?
0 commit comments