File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,11 @@ impl WalletSync for EsploraBlockchain {
127
127
. take ( self . concurrency as usize )
128
128
. cloned ( ) ;
129
129
130
- let handles = scripts. map ( move |script| {
130
+ let mut handles = vec ! [ ] ;
131
+ for script in scripts {
131
132
let client = self . url_client . clone ( ) ;
132
133
// make each request in its own thread.
133
- std:: thread:: spawn ( move || {
134
+ handles . push ( std:: thread:: spawn ( move || {
134
135
let mut related_txs: Vec < Tx > = client. _scripthash_txs ( & script, None ) ?;
135
136
136
137
let n_confirmed =
@@ -152,10 +153,11 @@ impl WalletSync for EsploraBlockchain {
152
153
}
153
154
}
154
155
Result :: < _ , Error > :: Ok ( related_txs)
155
- } )
156
- } ) ;
156
+ } ) ) ;
157
+ }
157
158
158
159
let txs_per_script: Vec < Vec < Tx > > = handles
160
+ . into_iter ( )
159
161
. map ( |handle| handle. join ( ) . unwrap ( ) )
160
162
. collect :: < Result < _ , _ > > ( ) ?;
161
163
let mut satisfaction = vec ! [ ] ;
You can’t perform that action at this time.
0 commit comments