| 1544 | } |
| 1545 | |
| 1546 | pub async fn start_time( |
| 1547 | &mut self, |
| 1548 | client: &AsyncClient, |
| 1549 | context: &OperatorContext, |
| 1550 | start_time_commitment_secret: &WinternitzSecret, |
| 1551 | ) -> Result<Transaction, Error> { |
| 1552 | verify_if_not_mined(client, self.start_time_transaction.tx().compute_txid()).await?; |
| 1553 | |
| 1554 | let kick_off_1_txid = self.kick_off_1_transaction.tx().compute_txid(); |
| 1555 | let kick_off_1_status = client.get_tx_status(&kick_off_1_txid).await; |
| 1556 | |
| 1557 | match kick_off_1_status { |
| 1558 | Ok(status) => match status.confirmed { |
| 1559 | true => { |
| 1560 | self.start_time_transaction.sign( |
| 1561 | context, |
| 1562 | &self.connector_2, |
| 1563 | get_start_time_block_number(context.network), |
| 1564 | start_time_commitment_secret, |
| 1565 | ); |
| 1566 | Ok(self.start_time_transaction.finalize()) |
| 1567 | } |
| 1568 | false => Err(Error::Graph(GraphError::PrecedingTxNotConfirmed(vec![ |
| 1569 | NamedTx::for_tx(&self.kick_off_1_transaction, status.confirmed), |
| 1570 | ]))), |
| 1571 | }, |
| 1572 | Err(e) => Err(Error::Esplora(e)), |
| 1573 | } |
| 1574 | } |
| 1575 | |
| 1576 | pub async fn start_time_timeout( |
| 1577 | &mut self, |