Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esplora indexer: detect mempool TXs #241

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/indexers/esplora_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
}

fn resolve_pub_witness_ord(&self, txid: Txid) -> Result<WitnessOrd, String> {
if self.tx(&txid)?.is_none() {
return Ok(WitnessOrd::Archived);
}

Check warning on line 43 in src/indexers/esplora_blocking.rs

View check run for this annotation

Codecov / codecov/patch

src/indexers/esplora_blocking.rs#L41-L43

Added lines #L41 - L43 were not covered by tests
let status = self.tx_status(&txid)?;
let ord = match status
.block_height
Expand All @@ -46,8 +49,7 @@
Some((h, t)) => {
WitnessOrd::Mined(WitnessPos::new(h, t as i64).ok_or(Error::InvalidServerData)?)
}
// TODO: Figure out how to detect mempool transactions
None => WitnessOrd::Archived,
None => WitnessOrd::Tentative,

Check warning on line 52 in src/indexers/esplora_blocking.rs

View check run for this annotation

Codecov / codecov/patch

src/indexers/esplora_blocking.rs#L52

Added line #L52 was not covered by tests
};
Ok(ord)
}
Expand Down
Loading