Skip to content

Commit

Permalink
Merge pull request #113 from xcshuan/master
Browse files Browse the repository at this point in the history
[BUG Fix] Deadlock issue of InputIterator
  • Loading branch information
quake authored May 13, 2024
2 parents 10e691a + 54aecec commit 0c08eaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/transaction/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl HandlerContexts {
}
}

pub fn add_context(mut self, context: Box<dyn HandlerContext>) {
pub fn add_context(&mut self, context: Box<dyn HandlerContext>) {
self.contexts.push(context);
}
}
5 changes: 5 additions & 0 deletions src/transaction/input/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod transaction_input;
use anyhow::{anyhow, Error};
use ckb_types::packed::Script;
pub use transaction_input::TransactionInput;

Expand Down Expand Up @@ -74,6 +75,10 @@ impl InputIterator {

fn collect_live_cells(&mut self) -> Result<(), CellCollectorError> {
loop {
if self.lock_scripts.len() == 0 {
return Ok(());
}

if let Some(lock_script) = self.lock_scripts.last() {
let mut query = CellQueryOptions::new_lock(lock_script.clone());
query.script_search_mode = Some(SearchMode::Exact);
Expand Down

0 comments on commit 0c08eaa

Please sign in to comment.