X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;fp=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;h=79d589c6521b0d0268d8a897d6950cdd97db0a96;hb=f4f1093edc506314484c8d52a40dd155e692394b;hp=7c6b48d144b79b06c67105cc50d609f238b7581f;hpb=ad82c9ea5bf735068c11c8eebdf68ac57f135eec;p=rust-lightning diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 7c6b48d1..79d589c6 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -33,34 +33,34 @@ use bitcoin::secp256k1::{Secp256k1, ecdsa::Signature}; use bitcoin::secp256k1::{SecretKey, PublicKey}; use bitcoin::secp256k1; -use ln::{PaymentHash, PaymentPreimage}; -use ln::msgs::DecodeError; -use ln::chan_utils; -use ln::chan_utils::{CounterpartyCommitmentSecrets, HTLCOutputInCommitment, HTLCClaim, ChannelTransactionParameters, HolderCommitmentTransaction}; -use ln::channelmanager::HTLCSource; -use chain; -use chain::{BestBlock, WatchedOutput}; -use chain::chaininterface::{BroadcasterInterface, FeeEstimator, LowerBoundedFeeEstimator}; -use chain::transaction::{OutPoint, TransactionData}; -use chain::keysinterface::{SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, Sign, KeysInterface}; +use crate::ln::{PaymentHash, PaymentPreimage}; +use crate::ln::msgs::DecodeError; +use crate::ln::chan_utils; +use crate::ln::chan_utils::{CounterpartyCommitmentSecrets, HTLCOutputInCommitment, HTLCClaim, ChannelTransactionParameters, HolderCommitmentTransaction}; +use crate::ln::channelmanager::HTLCSource; +use crate::chain; +use crate::chain::{BestBlock, WatchedOutput}; +use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator, LowerBoundedFeeEstimator}; +use crate::chain::transaction::{OutPoint, TransactionData}; +use crate::chain::keysinterface::{SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, Sign, KeysInterface}; #[cfg(anchors)] -use chain::onchaintx::ClaimEvent; -use chain::onchaintx::OnchainTxHandler; -use chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderFundingOutput, HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedOutput, RevokedHTLCOutput}; -use chain::Filter; -use util::logger::Logger; -use util::ser::{Readable, ReadableArgs, MaybeReadable, Writer, Writeable, U48, OptionDeserWrapper}; -use util::byte_utils; -use util::events::Event; +use crate::chain::onchaintx::ClaimEvent; +use crate::chain::onchaintx::OnchainTxHandler; +use crate::chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderFundingOutput, HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedOutput, RevokedHTLCOutput}; +use crate::chain::Filter; +use crate::util::logger::Logger; +use crate::util::ser::{Readable, ReadableArgs, MaybeReadable, Writer, Writeable, U48, OptionDeserWrapper}; +use crate::util::byte_utils; +use crate::util::events::Event; #[cfg(anchors)] -use util::events::{AnchorDescriptor, BumpTransactionEvent}; +use crate::util::events::{AnchorDescriptor, BumpTransactionEvent}; -use prelude::*; +use crate::prelude::*; use core::{cmp, mem}; -use io::{self, Error}; +use crate::io::{self, Error}; use core::convert::TryInto; use core::ops::Deref; -use sync::Mutex; +use crate::sync::Mutex; /// An update generated by the underlying channel itself which contains some new information the /// [`ChannelMonitor`] should be made aware of. @@ -3837,26 +3837,26 @@ mod tests { use crate::chain::chaininterface::LowerBoundedFeeEstimator; use super::ChannelMonitorUpdateStep; - use ::{check_added_monitors, check_closed_broadcast, check_closed_event, check_spends, get_local_commitment_txn, get_monitor, get_route_and_payment_hash, unwrap_send_err}; - use chain::{BestBlock, Confirm}; - use chain::channelmonitor::ChannelMonitor; - use chain::package::{weight_offered_htlc, weight_received_htlc, weight_revoked_offered_htlc, weight_revoked_received_htlc, WEIGHT_REVOKED_OUTPUT}; - use chain::transaction::OutPoint; - use chain::keysinterface::InMemorySigner; - use ln::{PaymentPreimage, PaymentHash}; - use ln::chan_utils; - use ln::chan_utils::{HTLCOutputInCommitment, ChannelPublicKeys, ChannelTransactionParameters, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters}; - use ln::channelmanager::{self, PaymentSendFailure}; - use ln::functional_test_utils::*; - use ln::script::ShutdownScript; - use util::errors::APIError; - use util::events::{ClosureReason, MessageSendEventsProvider}; - use util::test_utils::{TestLogger, TestBroadcaster, TestFeeEstimator}; - use util::ser::{ReadableArgs, Writeable}; - use sync::{Arc, Mutex}; - use io; + use crate::{check_added_monitors, check_closed_broadcast, check_closed_event, check_spends, get_local_commitment_txn, get_monitor, get_route_and_payment_hash, unwrap_send_err}; + use crate::chain::{BestBlock, Confirm}; + use crate::chain::channelmonitor::ChannelMonitor; + use crate::chain::package::{weight_offered_htlc, weight_received_htlc, weight_revoked_offered_htlc, weight_revoked_received_htlc, WEIGHT_REVOKED_OUTPUT}; + use crate::chain::transaction::OutPoint; + use crate::chain::keysinterface::InMemorySigner; + use crate::ln::{PaymentPreimage, PaymentHash}; + use crate::ln::chan_utils; + use crate::ln::chan_utils::{HTLCOutputInCommitment, ChannelPublicKeys, ChannelTransactionParameters, HolderCommitmentTransaction, CounterpartyChannelTransactionParameters}; + use crate::ln::channelmanager::{self, PaymentSendFailure}; + use crate::ln::functional_test_utils::*; + use crate::ln::script::ShutdownScript; + use crate::util::errors::APIError; + use crate::util::events::{ClosureReason, MessageSendEventsProvider}; + use crate::util::test_utils::{TestLogger, TestBroadcaster, TestFeeEstimator}; + use crate::util::ser::{ReadableArgs, Writeable}; + use crate::sync::{Arc, Mutex}; + use crate::io; use bitcoin::{PackedLockTime, Sequence, TxMerkleNode, Witness}; - use prelude::*; + use crate::prelude::*; fn do_test_funding_spend_refuses_updates(use_local_txn: bool) { // Previously, monitor updates were allowed freely even after a funding-spend transaction