Skip to content

Commit 789f78c

Browse files
committed
Fix listspaces performance
1 parent 83fce1e commit 789f78c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

client/src/wallets.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -820,19 +820,20 @@ impl RpcWallet {
820820
let mut pending = vec![];
821821
let mut outbid = vec![];
822822
for (txid, event) in recent_events {
823-
let tx = wallet.get_tx(txid);
824-
if tx.as_ref().is_some_and(|tx| !tx.chain_position.is_confirmed()) {
825-
pending.push(SLabel::from_str(event.space.as_ref().unwrap()).expect("valid space name"));
826-
continue;
827-
}
828-
829823
if unspent.iter().any(|out| {
830824
out.space
831825
.as_ref()
832826
.is_some_and(|s| &s.name.to_string() == event.space.as_ref().unwrap())
833827
}) {
834828
continue;
835829
}
830+
831+
let tx = wallet.get_tx(txid);
832+
if tx.as_ref().is_some_and(|tx| !tx.chain_position.is_confirmed()) {
833+
pending.push(SLabel::from_str(event.space.as_ref().unwrap()).expect("valid space name"));
834+
continue;
835+
}
836+
836837
let name = SLabel::from_str(event.space.as_ref().unwrap()).expect("valid space name");
837838
let spacehash = SpaceKey::from(Sha256::hash(name.as_ref()));
838839
let space = state.get_space_info(&spacehash)?;

0 commit comments

Comments
 (0)