MCPcopy Create free account
hub / github.com/BitVM/BitVM / refund

Method refund

bridge/src/graphs/peg_in.rs:475–491  ·  view source on GitHub ↗
(&mut self, client: &AsyncClient)

Source from the content-addressed store, hash-verified

473 }
474
475 pub async fn refund(&mut self, client: &AsyncClient) -> Result<Transaction, Error> {
476 let txid = self.peg_in_refund_transaction.tx().compute_txid();
477 verify_if_not_mined(client, txid).await?;
478
479 let deposit_txid = self.peg_in_deposit_transaction.tx().compute_txid();
480 let deposit_status = client.get_tx_status(&deposit_txid).await;
481
482 match deposit_status {
483 Ok(status) => match status.confirmed {
484 true => Ok(self.peg_in_refund_transaction.finalize()),
485 false => Err(Error::Graph(GraphError::PrecedingTxNotConfirmed(vec![
486 NamedTx::for_tx(&self.peg_in_deposit_transaction, status.confirmed),
487 ]))),
488 },
489 Err(e) => Err(Error::Esplora(e)),
490 }
491 }
492
493 async fn get_peg_in_statuses(
494 &self,

Callers 2

test_peg_in_feesFunction · 0.80

Calls 3

verify_if_not_minedFunction · 0.85
txMethod · 0.45
finalizeMethod · 0.45

Tested by 1

test_peg_in_feesFunction · 0.64