Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request RGB-WG#214 from zoedberg/fix_electrum_resolver_off…
Browse files Browse the repository at this point in the history
…chain

fix electrum resolve_height for offchain TXs
  • Loading branch information
dr-orlovsky authored Jun 25, 2024
2 parents 0097724 + 2cd242a commit 1c1844c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/resolvers/electrum_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,19 @@ impl RgbResolver for Client {

// Now we get and parse transaction information to get the number of
// confirmations
let tx_details = check!(self.raw_call("blockchain.transaction.get", vec![
let tx_details = match self.raw_call("blockchain.transaction.get", vec![
Param::String(txid.to_string()),
Param::Bool(true),
]));
]) {
Err(e)
if e.to_string()
.contains("No such mempool or blockchain transaction") =>
{
return Ok(witness_anchor);
}
Err(e) => return Err(e.to_string()),
Ok(v) => v,
};
let forward = iter::from_fn(|| self.block_headers_pop().ok().flatten()).count() as isize;

let Some(confirmations) = tx_details.get("confirmations") else {
Expand Down

0 comments on commit 1c1844c

Please sign in to comment.