Skip to content

Commit

Permalink
handle not existing transaction error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantamis committed Jul 29, 2021
1 parent f927f67 commit 2f8d5e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ impl Rpc {

let funding_tx = match self.daemon.get_transaction(&funding.txid, funding_blockhash) {
Ok(tx) => tx,
Err(_) => return Ok(json!({})),
Err(error) => {
match error.downcast_ref::<bitcoincore_rpc::Error>() {
Some(_) => return Ok(json!({})),
None => return Err(error),
}
},
};
let funding_inputs = &funding_tx.input;
let funding_height = match &funding_blockhash {
Expand Down

0 comments on commit 2f8d5e1

Please sign in to comment.