From 7f4690649ba4ea54434a0d21f1b9a348131a46da Mon Sep 17 00:00:00 2001 From: Blake <0xblake.sg@gmail.com> Date: Mon, 7 Sep 2026 10:44:28 +0800 Subject: [PATCH] Fix `upsert_pegin_request_instance` logic by removing `is_bridge_in` checks and unused fields. --- crates/store/src/localdb.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/store/src/localdb.rs b/crates/store/src/localdb.rs index 2b655e2b..aa8e2f9b 100644 --- a/crates/store/src/localdb.rs +++ b/crates/store/src/localdb.rs @@ -1174,8 +1174,8 @@ impl<'a> StorageProcessor<'a> { /// /// Returns: /// - Ok(true) if the row was inserted or updated - /// - Ok(false) if an existing row was left untouched because it is not a - /// bridge-in instance, or its status is outside `allowed_statuses` + /// - Ok(false) if an existing row was left untouched because its status + /// is outside `allowed_statuses` pub async fn upsert_pegin_request_instance( &mut self, instance: &Instance, @@ -1192,12 +1192,12 @@ impl<'a> StorageProcessor<'a> { }; let sql = format!( "INSERT INTO instance \ - (instance_id, is_bridge_in, network, from_addr, to_addr, amount, fees, input_utxos, \ + (instance_id, network, from_addr, to_addr, amount, fees, input_utxos, \ status, goat_tx_hash, goat_tx_height, user_xonly_pubkey, user_change_addr, \ user_refund_addr, btc_txid, pegin_confirm_txid, pegin_cancel_txid, committees_answers, \ - pegin_data_tx_hash, btc_height, parameters, status_updated_at, escrow_hash, \ - bridge_out_lock_time, post_pegin_txhash, bridge_out_amount, created_at, updated_at) \ - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) \ + pegin_data_tx_hash, btc_height, parameters, status_updated_at, \ + post_pegin_txhash, created_at, updated_at) \ + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) \ ON CONFLICT(instance_id) DO UPDATE SET \ network = excluded.network, \ from_addr = CASE WHEN excluded.from_addr = '' \ @@ -1214,7 +1214,7 @@ impl<'a> StorageProcessor<'a> { user_refund_addr = excluded.user_refund_addr, \ status_updated_at = excluded.status_updated_at, \ updated_at = excluded.updated_at \ - WHERE instance.is_bridge_in = excluded.is_bridge_in AND {status_guard}" + WHERE {status_guard}" ); let mut query = sqlx::query(&sql) .bind(instance.instance_id)