Skip to content

Commit

Permalink
fix: only pending to committed of tx (#2217)
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid authored Oct 9, 2024
1 parent 018cd2b commit 148c3ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ckb_sync/new_node_data_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ def build_ckb_transactions!(node_block, local_block, inputs, outputs, outputs_da
pending_txs = CkbTransaction.where("tx_hash IN (#{binary_hashes})").where(tx_status: :pending).pluck(
:tx_hash, :confirmation_time
)
CkbTransaction.where("tx_hash IN (#{binary_hashes})").update_all tx_status: "committed"
CkbTransaction.where("tx_hash IN (#{binary_hashes}) AND tx_status = 0").update_all tx_status: "committed"

txs = CkbTransaction.upsert_all(ckb_transactions_attributes, unique_by: %i[tx_status tx_hash],
returning: %w(id tx_hash block_timestamp created_at))
Expand Down

0 comments on commit 148c3ab

Please sign in to comment.