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

Method confirm

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

Source from the content-addressed store, hash-verified

455 }
456
457 pub async fn confirm(&mut self, client: &AsyncClient) -> Result<Transaction, Error> {
458 let txid = self.peg_in_confirm_transaction.tx().compute_txid();
459 verify_if_not_mined(client, txid).await?;
460
461 let deposit_txid = self.peg_in_deposit_transaction.tx().compute_txid();
462 let deposit_status = client.get_tx_status(&deposit_txid).await;
463
464 match deposit_status {
465 Ok(status) => match status.confirmed {
466 true => Ok(self.peg_in_confirm_transaction.finalize()),
467 false => Err(Error::Graph(GraphError::PrecedingTxNotConfirmed(vec![
468 NamedTx::for_tx(&self.peg_in_deposit_transaction, status.confirmed),
469 ]))),
470 },
471 Err(e) => Err(Error::Esplora(e)),
472 }
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();

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