X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fsign%2Fmod.rs;h=bc15a3a7662c0dd12b06aab8b1927ee2f6e2eab3;hb=8bd4a8f3031342e908889e26ad6ebb797f8609b7;hp=0c293a98c9070e60f8d1f0c5d9284d365d3e7633;hpb=6a55dcce8380297c28dc70c37ef543bd18f62617;p=rust-lightning diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs index 0c293a98..bc15a3a7 100644 --- a/lightning/src/sign/mod.rs +++ b/lightning/src/sign/mod.rs @@ -12,13 +12,16 @@ //! The provided output descriptors follow a custom LDK data format and are currently not fully //! compatible with Bitcoin Core output descriptors. -use bitcoin::blockdata::transaction::{Transaction, TxOut, TxIn, EcdsaSighashType}; -use bitcoin::blockdata::script::{Script, Builder}; +use bitcoin::blockdata::locktime::absolute::LockTime; +use bitcoin::blockdata::transaction::{Transaction, TxOut, TxIn}; +use bitcoin::blockdata::script::{Script, ScriptBuf, Builder}; use bitcoin::blockdata::opcodes; +use bitcoin::ecdsa::Signature as EcdsaSignature; use bitcoin::network::constants::Network; use bitcoin::psbt::PartiallySignedTransaction; -use bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey, ChildNumber}; -use bitcoin::util::sighash; +use bitcoin::bip32::{ExtendedPrivKey, ExtendedPubKey, ChildNumber}; +use bitcoin::sighash; +use bitcoin::sighash::EcdsaSighashType; use bitcoin::bech32::u5; use bitcoin::hashes::{Hash, HashEngine}; @@ -30,13 +33,12 @@ use bitcoin::secp256k1::{KeyPair, PublicKey, Scalar, Secp256k1, SecretKey, Signi use bitcoin::secp256k1::ecdh::SharedSecret; use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature}; use bitcoin::secp256k1::schnorr; -use bitcoin::{PackedLockTime, secp256k1, Sequence, Witness}; +use bitcoin::{secp256k1, Sequence, Witness, Txid}; use crate::util::transaction_utils; use crate::util::crypto::{hkdf_extract_expand_twice, sign, sign_with_aux_rand}; use crate::util::ser::{Writeable, Writer, Readable, ReadableArgs}; use crate::chain::transaction::OutPoint; -use crate::events::bump_transaction::HTLCDescriptor; use crate::ln::channel::ANCHOR_OUTPUT_VALUE_SATOSHI; use crate::ln::{chan_utils, PaymentPreimage}; use crate::ln::chan_utils::{HTLCOutputInCommitment, make_funding_redeemscript, ChannelPublicKeys, HolderCommitmentTransaction, ChannelTransactionParameters, CommitmentTransaction, ClosingTransaction}; @@ -94,7 +96,7 @@ impl DelayedPaymentOutputDescriptor { /// shorter. // Calculated as 1 byte length + 73 byte signature, 1 byte empty vec push, 1 byte length plus // redeemscript push length. - pub const MAX_WITNESS_LENGTH: usize = 1 + 73 + 1 + chan_utils::REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH + 1; + pub const MAX_WITNESS_LENGTH: u64 = 1 + 73 + 1 + chan_utils::REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH as u64 + 1; } impl_writeable_tlv_based!(DelayedPaymentOutputDescriptor, { @@ -138,7 +140,7 @@ impl StaticPaymentOutputDescriptor { /// /// Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that /// originated from an anchor outputs channel, as they take the form of a P2WSH script. - pub fn witness_script(&self) -> Option