From ade1b9e8cdbda3ef7174494d64c401a03cf0fbea Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Thu, 29 Aug 2024 11:28:23 +0800 Subject: [PATCH] fix leap unlock tx --- .../src/branch_to_rgbpp/mod.rs | 27 ++++++++----------- .../rgbpp-tx/src/branch_to_rgbpp/unlock.rs | 8 ++---- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/aggregator/aggregator-main/src/branch_to_rgbpp/mod.rs b/aggregator/aggregator-main/src/branch_to_rgbpp/mod.rs index 8677e0e28e..169d479824 100644 --- a/aggregator/aggregator-main/src/branch_to_rgbpp/mod.rs +++ b/aggregator/aggregator-main/src/branch_to_rgbpp/mod.rs @@ -150,34 +150,29 @@ impl Aggregator { tx_hash.0.into(), requests_in_witness.raw_data(), ); - let inbox_tx = match inbox_tx { - Ok(inbox_tx) => { - H256::from_slice(inbox_tx.as_bytes()).expect("unlock tx to H256") + let _ = match inbox_tx { + Ok(_) => { + self.store + .commit_branch_request(height) + .expect("commit branch request"); } Err(e) => { error!("{}", e.to_string()); continue; } }; - match wait_for_tx_confirmation( - self.rgbpp_rpc_client.clone(), - H256(inbox_tx.0), - Duration::from_secs(30), - ) { - Ok(_) => { - self.store - .commit_branch_request(height) - .expect("commit branch request"); - } - Err(e) => error!("{}", e.to_string()), - } } } } let unlock_tx = self.rgbpp_tx_builder.create_unlock_tx(); let unlock_tx = match unlock_tx { - Ok(unlock_tx) => unlock_tx, + Ok(unlock_tx) => { + if H256(unlock_tx.0) == H256::default() { + continue; + } + unlock_tx + } Err(e) => { error!("{}", e.to_string()); continue; diff --git a/aggregator/util/rgbpp-tx/src/branch_to_rgbpp/unlock.rs b/aggregator/util/rgbpp-tx/src/branch_to_rgbpp/unlock.rs index 8f7a153fc0..017409af30 100644 --- a/aggregator/util/rgbpp-tx/src/branch_to_rgbpp/unlock.rs +++ b/aggregator/util/rgbpp-tx/src/branch_to_rgbpp/unlock.rs @@ -40,9 +40,9 @@ impl RgbppTxBuilder { self.get_rgbpp_queue_cell(self.rgbpp_queue_inbox_lock_key_path.clone())?; info!( "The queue inbox contains {} requests that need to be unlock.", - queue_cell_data.outbox().len() + queue_cell_data.inbox().len() ); - if queue_cell_data.outbox().is_empty() { + if queue_cell_data.inbox().is_empty() { return Ok(H256::default()); } @@ -161,10 +161,6 @@ impl RgbppTxBuilder { // custodian lock script let (custodian_lock_script_args, custodian_lock_key) = get_sighash_lock_args_from_privkey(self.rgbpp_custodian_lock_key_path.clone())?; - info!( - "Custodian lock script args: {:?}", - custodian_lock_script_args - ); let custodian_lock_script = Script::new_builder() .code_hash(SIGHASH_TYPE_HASH.pack()) .hash_type(ScriptHashType::Type.into())