pub fn is_confirmed(&self) -> bool {
matches!(self, Self::Confirmed { .. })
}
+
+ /// Returns whether [`ChainPosition`] is unconfirmed or not.
+ pub fn is_unconfirmed(&self) -> bool {
+ matches!(self, Self::Unconfirmed { .. })
+ }
}
impl<A: Clone> ChainPosition<&A> {
pub tx_node: TxNode<'a, T, A>,
}
+impl<'a, T, A> From<CanonicalTx<'a, T, A>> for Txid {
+ fn from(tx: CanonicalTx<'a, T, A>) -> Self {
+ tx.tx_node.txid
+ }
+}
+
+impl<'a, A> From<CanonicalTx<'a, Arc<Transaction>, A>> for Arc<Transaction> {
+ fn from(tx: CanonicalTx<'a, Arc<Transaction>, A>) -> Self {
+ tx.tx_node.tx
+ }
+}
+
/// Errors returned by `TxGraph::calculate_fee`.
#[derive(Debug, PartialEq, Eq)]
pub enum CalculateFeeError {