X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Ftransaction.rs;h=13ecf2539a21de1a4c1f5c2409b1f9619e5bc5f0;hb=refs%2Fheads%2Fupstream%2Fmain;hp=17815207a8dcf92355dc762cdfd0e66afc0c33f5;hpb=a634fd1dad468e4af51b508b3a0245f9655d129e;p=rust-lightning diff --git a/lightning/src/chain/transaction.rs b/lightning/src/chain/transaction.rs index 17815207..13ecf253 100644 --- a/lightning/src/chain/transaction.rs +++ b/lightning/src/chain/transaction.rs @@ -25,7 +25,7 @@ use bitcoin::blockdata::transaction::Transaction; /// /// use bitcoin::blockdata::block::Block; /// use bitcoin::blockdata::constants::genesis_block; -/// use bitcoin::network::constants::Network; +/// use bitcoin::network::Network; /// use lightning::chain::transaction::TransactionData; /// /// let block = genesis_block(Network::Bitcoin); @@ -58,7 +58,7 @@ pub struct OutPoint { impl OutPoint { /// Converts this OutPoint into the OutPoint field as used by rust-bitcoin /// - /// This is not exported to bindings users as the same type is used universally in the C bindings + /// This is not exported to bindings users as the same type is used universally in the C bindings /// for all outpoints pub fn into_bitcoin_outpoint(self) -> BitcoinOutPoint { BitcoinOutPoint { @@ -76,10 +76,19 @@ impl core::fmt::Display for OutPoint { impl_writeable!(OutPoint, { txid, index }); +#[derive(Debug, Clone)] +pub(crate) struct MaybeSignedTransaction(pub Transaction); + +impl MaybeSignedTransaction { + pub fn is_fully_signed(&self) -> bool { + !self.0.input.iter().any(|input| input.witness.is_empty()) + } +} + #[cfg(test)] mod tests { use crate::chain::transaction::OutPoint; - use crate::ln::ChannelId; + use crate::ln::types::ChannelId; use bitcoin::blockdata::transaction::Transaction; use bitcoin::consensus::encode;