PaymentForwardNode, PaymentRelay, ReceiveTlvs,
};
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
-use lightning::ln::features::BlindedHopFeatures;
use lightning::ln::types::PaymentSecret;
use lightning::ln::PaymentHash;
use lightning::offers::invoice::UnsignedBolt12Invoice;
use lightning::offers::offer::OfferId;
use lightning::offers::parse::Bolt12SemanticError;
use lightning::sign::EntropySource;
+use lightning::types::features::BlindedHopFeatures;
use lightning::util::ser::Writeable;
use lightning::util::string::UntrustedString;
AsyncPaymentsContext, BlindedMessagePath, MessageContext, OffersContext,
};
use lightning::blinded_path::EmptyNodeIdLookUp;
-use lightning::ln::features::InitFeatures;
use lightning::ln::msgs::{self, DecodeError, OnionMessageHandler};
use lightning::ln::peer_handler::IgnoringMessageHandler;
use lightning::ln::script::ShutdownScript;
use lightning::onion_message::offers::{OffersMessage, OffersMessageHandler};
use lightning::onion_message::packet::OnionMessageContents;
use lightning::sign::{EntropySource, KeyMaterial, NodeSigner, Recipient, SignerProvider};
+use lightning::types::features::InitFeatures;
use lightning::util::logger::Logger;
use lightning::util::ser::{Readable, Writeable, Writer};
use lightning::util::test_channel_signer::TestChannelSigner;
PaymentForwardNode, PaymentRelay, ReceiveTlvs,
};
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
-use lightning::ln::features::BlindedHopFeatures;
use lightning::ln::types::PaymentSecret;
use lightning::ln::PaymentHash;
use lightning::offers::invoice::UnsignedBolt12Invoice;
use lightning::offers::parse::Bolt12SemanticError;
use lightning::offers::refund::Refund;
use lightning::sign::EntropySource;
+use lightning::types::features::BlindedHopFeatures;
use lightning::util::ser::Writeable;
#[inline]
use lightning::chain::transaction::OutPoint;
use lightning::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState};
use lightning::ln::channelmanager;
-use lightning::ln::features::{BlindedHopFeatures, Bolt12InvoiceFeatures};
use lightning::ln::msgs;
use lightning::ln::types::ChannelId;
use lightning::routing::gossip::{NetworkGraph, RoutingFees};
ProbabilisticScorer, ProbabilisticScoringDecayParameters, ProbabilisticScoringFeeParameters,
};
use lightning::routing::utxo::{UtxoFuture, UtxoLookup, UtxoLookupError, UtxoResult};
+use lightning::types::features::{BlindedHopFeatures, Bolt12InvoiceFeatures};
use lightning::util::config::UserConfig;
use lightning::util::hash_tables::*;
use lightning::util::ser::Readable;
use lightning::ln::channelmanager::{
ChainParameters, PaymentId, BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA,
};
- use lightning::ln::features::{ChannelFeatures, NodeFeatures};
use lightning::ln::functional_test_utils::*;
use lightning::ln::msgs::{ChannelMessageHandler, Init};
use lightning::ln::peer_handler::{
use lightning::routing::router::{CandidateRouteHop, DefaultRouter, Path, RouteHop};
use lightning::routing::scoring::{ChannelUsage, LockableScore, ScoreLookUp, ScoreUpdate};
use lightning::sign::{ChangeDestinationSource, InMemorySigner, KeysManager};
+ use lightning::types::features::{ChannelFeatures, NodeFeatures};
use lightning::util::config::UserConfig;
use lightning::util::persist::{
KVStore, CHANNEL_MANAGER_PERSISTENCE_KEY, CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE,
//! # use bitcoin::secp256k1::PublicKey;
//! # use lightning::io;
//! # use lightning::ln::msgs::{DecodeError, Init, LightningError};
-//! # use lightning::ln::features::{InitFeatures, NodeFeatures};
//! use lightning::ln::peer_handler::CustomMessageHandler;
//! use lightning::ln::wire::{CustomMessageReader, self};
+//! # use lightning::types::features::{InitFeatures, NodeFeatures};
//! use lightning::util::ser::Writeable;
//! # use lightning::util::ser::Writer;
//!
result
}
- fn provided_node_features(&self) -> $crate::lightning::ln::features::NodeFeatures {
- $crate::lightning::ln::features::NodeFeatures::empty()
+ fn provided_node_features(&self) -> $crate::lightning::types::features::NodeFeatures {
+ $crate::lightning::types::features::NodeFeatures::empty()
$(
| self.$field.provided_node_features()
)*
fn provided_init_features(
&self, their_node_id: $crate::bitcoin::secp256k1::PublicKey
- ) -> $crate::lightning::ln::features::InitFeatures {
- $crate::lightning::ln::features::InitFeatures::empty()
+ ) -> $crate::lightning::types::features::InitFeatures {
+ $crate::lightning::types::features::InitFeatures::empty()
$(
| self.$field.provided_init_features(their_node_id)
)*
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use bitcoin::Network;
use lightning::events::*;
- use lightning::ln::features::*;
use lightning::ln::msgs::*;
use lightning::ln::peer_handler::{IgnoringMessageHandler, MessageHandler, PeerManager};
use lightning::routing::gossip::NodeId;
+ use lightning::types::features::*;
use lightning::util::test_utils::TestNodeSigner;
use tokio::sync::mpsc;
#[cfg(all(not(feature = "std"), not(test)))]
use alloc::{borrow::ToOwned, vec::Vec};
-use lightning::ln::features::NodeFeatures;
+use lightning::types::features::NodeFeatures;
/// The purpose of this prefix is to identify the serialization format, should other rapid gossip
/// sync formats arise in the future.
use crate::io::Cursor;
use crate::ln::types::PaymentSecret;
use crate::ln::channel_state::CounterpartyForwardingInfo;
-use crate::ln::features::BlindedHopFeatures;
+use crate::types::features::BlindedHopFeatures;
use crate::ln::msgs::DecodeError;
use crate::ln::onion_utils;
use crate::offers::invoice_request::InvoiceRequestFields;
use bitcoin::secp256k1::PublicKey;
use crate::blinded_path::payment::{PaymentForwardNode, ForwardTlvs, ReceiveTlvs, PaymentConstraints, PaymentContext, PaymentRelay};
use crate::ln::types::PaymentSecret;
- use crate::ln::features::BlindedHopFeatures;
+ use crate::types::features::BlindedHopFeatures;
use crate::ln::functional_test_utils::TEST_FINAL_CLTV;
#[test]
use crate::util::logger::Logger;
use crate::sync::Arc;
use crate::io;
- use crate::ln::features::ChannelTypeFeatures;
+ use crate::types::features::ChannelTypeFeatures;
#[allow(unused_imports)]
use crate::prelude::*;
use core::ops::Deref;
use core::mem::replace;
use core::mem::swap;
-use crate::ln::features::ChannelTypeFeatures;
+use crate::types::features::ChannelTypeFeatures;
const MAX_ALLOC_SIZE: usize = 64*1024;
use crate::ln::types::PaymentPreimage;
use crate::ln::chan_utils::{self, TxCreationKeys, HTLCOutputInCommitment};
-use crate::ln::features::ChannelTypeFeatures;
+use crate::types::features::ChannelTypeFeatures;
use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint};
use crate::ln::msgs::DecodeError;
use crate::chain::chaininterface::{FeeEstimator, ConfirmationTarget, MIN_RELAY_FEE_SAT_PER_1000_WEIGHT, compute_feerate_sat_per_1000_weight, FEERATE_FLOOR_SATS_PER_KW};
use bitcoin::secp256k1::{PublicKey,SecretKey};
use bitcoin::secp256k1::Secp256k1;
- use crate::ln::features::ChannelTypeFeatures;
+ use crate::types::features::ChannelTypeFeatures;
use std::str::FromStr;
use crate::chain::transaction;
use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
-use crate::ln::features::ChannelTypeFeatures;
+use crate::types::features::ChannelTypeFeatures;
use crate::ln::msgs;
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
use crate::offers::invoice::Bolt12Invoice;
use crate::ln::types::{ChannelId, PaymentHash, PaymentSecret};
use crate::ln::channelmanager;
use crate::ln::channelmanager::{HTLCFailureMsg, PaymentId, RecipientOnionFields};
-use crate::ln::features::{BlindedHopFeatures, ChannelFeatures, NodeFeatures};
+use crate::types::features::{BlindedHopFeatures, ChannelFeatures, NodeFeatures};
use crate::ln::functional_test_utils::*;
use crate::ln::msgs;
use crate::ln::msgs::{ChannelMessageHandler, UnsignedGossipMessage};
use crate::ln::channel::{INITIAL_COMMITMENT_NUMBER, ANCHOR_OUTPUT_VALUE_SATOSHI};
use core::ops::Deref;
use crate::chain;
-use crate::ln::features::ChannelTypeFeatures;
+use crate::types::features::ChannelTypeFeatures;
use crate::crypto::utils::{sign, sign_with_aux_rand};
use super::channel_keys::{DelayedPaymentBasepoint, DelayedPaymentKey, HtlcKey, HtlcBasepoint, RevocationKey, RevocationBasepoint};
use bitcoin::hex::FromHex;
use crate::ln::types::PaymentHash;
use bitcoin::PublicKey as BitcoinPublicKey;
- use crate::ln::features::ChannelTypeFeatures;
+ use crate::types::features::ChannelTypeFeatures;
#[allow(unused_imports)]
use crate::prelude::*;
use bitcoin::secp256k1;
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash};
-use crate::ln::features::{ChannelTypeFeatures, InitFeatures};
+use crate::types::features::{ChannelTypeFeatures, InitFeatures};
use crate::ln::msgs;
use crate::ln::msgs::{ClosingSigned, ClosingSignedFeeRange, DecodeError};
use crate::ln::script::{self, ShutdownScript};
use crate::ln::channel::InitFeatures;
use crate::ln::channel::{AwaitingChannelReadyFlags, Channel, ChannelState, InboundHTLCOutput, OutboundV1Channel, InboundV1Channel, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator, HTLCUpdateAwaitingACK, commit_tx_fee_sat};
use crate::ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS, MIN_THEIR_CHAN_RESERVE_SATOSHIS};
- use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, NodeFeatures};
+ use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::msgs::{ChannelUpdate, DecodeError, UnsignedChannelUpdate, MAX_VALUE_MSAT};
use crate::ln::script::ShutdownScript;
use crate::chain::transaction::OutPoint;
use crate::io;
use crate::ln::channel::ChannelContext;
-use crate::ln::features::{ChannelTypeFeatures, InitFeatures};
use crate::ln::msgs::DecodeError;
use crate::ln::types::{ChannelId, PaymentHash};
use crate::sign::SignerProvider;
+use crate::types::features::{ChannelTypeFeatures, InitFeatures};
use crate::util::config::ChannelConfig;
use crate::util::ser::{Readable, Writeable, Writer};
use crate::ln::types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
use crate::ln::channel::{self, Channel, ChannelPhase, ChannelContext, ChannelError, ChannelUpdateStatus, ShutdownResult, UnfundedChannelContext, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel, WithChannelContext};
use crate::ln::channel_state::ChannelDetails;
-use crate::ln::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
+use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
#[cfg(any(feature = "_test_utils", test))]
-use crate::ln::features::Bolt11InvoiceFeatures;
+use crate::types::features::Bolt11InvoiceFeatures;
use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, Route, RouteParameters, Router};
use crate::ln::onion_payment::{check_incoming_htlc_cltv, create_recv_pending_htlc_info, create_fwd_pending_htlc_info, decode_incoming_update_add_htlc_onion, InboundHTLCErr, NextPacketDetails};
use crate::ln::msgs;
// You may not use this file except in accordance with one or both of these
// licenses.
-//! Feature flag definitions for the Lightning protocol according to [BOLT #9].
-//!
-//! See [`lightning_types::features`] for the list of features currently supported.
-//!
-//! Note that the use of types via this module is deprecated and will be removed in a future
-//! version. Instead, use feature objects via [`lightning::types::features`].
-//!
-//! [`lightning::types::features`]: crate::types::features
-//! [BOLT #9]: https://github.com/lightning/bolts/blob/master/09-features.md
-
-pub use lightning_types::features::Features;
-pub use lightning_types::features::{InitFeatures, NodeFeatures, ChannelFeatures};
-pub use lightning_types::features::{Bolt11InvoiceFeatures, OfferFeatures, InvoiceRequestFeatures};
-pub use lightning_types::features::{Bolt12InvoiceFeatures, BlindedHopFeatures};
-pub use lightning_types::features::ChannelTypeFeatures;
+//! Implementations of extensions on features.
+
+use lightning_types::features::{InitFeatures, NodeFeatures, ChannelFeatures};
+use lightning_types::features::{Bolt11InvoiceFeatures, OfferFeatures, InvoiceRequestFeatures};
+use lightning_types::features::{Bolt12InvoiceFeatures, BlindedHopFeatures};
+use lightning_types::features::ChannelTypeFeatures;
#[allow(unused_imports)]
use crate::prelude::*;
use crate::events::bump_transaction::{BumpTransactionEvent, BumpTransactionEventHandler, Wallet, WalletSource};
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
use crate::ln::channelmanager::{AChannelManager, ChainParameters, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure, RecipientOnionFields, PaymentId, MIN_CLTV_EXPIRY_DELTA};
-use crate::ln::features::InitFeatures;
+use crate::types::features::InitFeatures;
use crate::ln::msgs;
use crate::ln::msgs::{ChannelMessageHandler, OnionMessageHandler, RoutingMessageHandler};
use crate::ln::peer_handler::IgnoringMessageHandler;
use crate::ln::chan_utils::{commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC, OFFERED_HTLC_SCRIPT_WEIGHT, htlc_success_tx_weight, htlc_timeout_tx_weight, HTLCOutputInCommitment};
use crate::routing::gossip::{NetworkGraph, NetworkUpdate};
use crate::routing::router::{Path, PaymentParameters, Route, RouteHop, get_route, RouteParameters};
-use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, NodeFeatures};
+use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler, ErrorAction};
use crate::util::test_channel_signer::TestChannelSigner;
use crate::ln::PaymentSecret;
use crate::ln::blinded_payment_tests::get_blinded_route_parameters;
use crate::ln::channelmanager::PaymentId;
-use crate::ln::features::BlindedHopFeatures;
+use crate::types::features::BlindedHopFeatures;
use crate::ln::functional_test_utils::*;
use crate::ln::msgs;
use crate::ln::msgs::OnionMessageHandler;
use crate::blinded_path::payment::{BlindedPaymentTlvs, ForwardTlvs, ReceiveTlvs};
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
-use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
+use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
use crate::ln::onion_utils;
use crate::onion_message;
use crate::sign::{NodeSigner, Recipient};
use bitcoin::secp256k1::PublicKey;
use crate::blinded_path::payment::{PaymentConstraints, PaymentContext, PaymentRelay};
use crate::ln::types::{PaymentPreimage, PaymentSecret};
- use crate::ln::features::BlindedHopFeatures;
+ use crate::types::features::BlindedHopFeatures;
use super::{FinalOnionHopData, TrampolineOnionPacket};
#[allow(unused_imports)]
use bitcoin::{Amount, Transaction, TxIn, ScriptBuf, Sequence, Witness, TxOut};
use bitcoin::hex::DisplayHex;
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
- use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
+ use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
use crate::ln::msgs::{self, FinalOnionHopData, OnionErrorPacket, CommonOpenChannelFields, CommonAcceptChannelFields, TrampolineOnionPacket};
use crate::ln::msgs::SocketAddress;
use crate::routing::gossip::{NodeAlias, NodeId};
use crate::blinded_path::message::{MessageContext, OffersContext};
use crate::events::{ClosureReason, Event, MessageSendEventsProvider, PaymentFailureReason, PaymentPurpose};
use crate::ln::channelmanager::{Bolt12PaymentError, MAX_SHORT_LIVED_RELATIVE_EXPIRY, PaymentId, RecentPaymentDetails, Retry, self};
-use crate::ln::features::Bolt12InvoiceFeatures;
+use crate::types::features::Bolt12InvoiceFeatures;
use crate::ln::functional_test_utils::*;
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::{ChannelMessageHandler, Init, NodeAnnouncement, OnionMessage, OnionMessageHandler, RoutingMessageHandler, SocketAddress, UnsignedGossipMessage, UnsignedNodeAnnouncement};
use crate::chain::channelmonitor::{HTLC_FAIL_BACK_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
use crate::ln::types::PaymentHash;
use crate::ln::channelmanager::{BlindedFailure, BlindedForward, CLTV_FAR_FAR_AWAY, HTLCFailureMsg, MIN_CLTV_EXPIRY_DELTA, PendingHTLCInfo, PendingHTLCRouting};
-use crate::ln::features::BlindedHopFeatures;
+use crate::types::features::BlindedHopFeatures;
use crate::ln::msgs;
use crate::ln::onion_utils;
use crate::ln::onion_utils::{HTLCFailReason, INVALID_ONION_BLINDING};
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
use crate::ln::channelmanager::RecipientOnionFields;
- use crate::ln::features::{ChannelFeatures, NodeFeatures};
+ use crate::types::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::onion_utils::create_payment_onion;
use crate::routing::router::{Path, RouteHop};
use crate::ln::onion_utils;
use crate::routing::gossip::{NetworkUpdate, RoutingFees};
use crate::routing::router::{get_route, PaymentParameters, Route, RouteParameters, RouteHint, RouteHintHop};
-use crate::ln::features::{InitFeatures, Bolt11InvoiceFeatures};
+use crate::types::features::{InitFeatures, Bolt11InvoiceFeatures};
use crate::ln::functional_test_utils::test_default_channel_config;
use crate::ln::msgs;
use crate::ln::msgs::{ChannelMessageHandler, ChannelUpdate, OutboundTrampolinePayload};
use crate::crypto::streams::ChaChaReader;
use crate::ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS;
use crate::ln::channelmanager::{HTLCSource, RecipientOnionFields};
-use crate::ln::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::types::{PaymentHash, PaymentPreimage};
use crate::routing::gossip::NetworkUpdate;
use crate::routing::router::{Path, RouteHop, RouteParameters};
use crate::sign::NodeSigner;
+use crate::types::features::{ChannelFeatures, NodeFeatures};
use crate::util::errors::{self, APIError};
use crate::util::logger::Logger;
use crate::util::ser::{LengthCalculatingWriter, Readable, ReadableArgs, Writeable, Writer};
#[cfg(test)]
mod tests {
use crate::io;
- use crate::ln::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::types::PaymentHash;
use crate::routing::router::{Path, Route, RouteHop};
+ use crate::types::features::{ChannelFeatures, NodeFeatures};
use crate::util::ser::{VecWriter, Writeable, Writer};
#[allow(unused_imports)]
use crate::ln::types::{PaymentHash, PaymentPreimage, PaymentSecret};
use crate::ln::channel_state::ChannelDetails;
use crate::ln::channelmanager::{EventCompletionAction, HTLCSource, PaymentId};
-use crate::ln::features::Bolt12InvoiceFeatures;
+use crate::types::features::Bolt12InvoiceFeatures;
use crate::ln::onion_utils;
use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
use crate::offers::invoice::Bolt12Invoice;
use crate::events::{Event, PathFailure, PaymentFailureReason};
use crate::ln::types::{PaymentHash, PaymentPreimage};
use crate::ln::channelmanager::{PaymentId, RecipientOnionFields};
- use crate::ln::features::{Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
+ use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
use crate::ln::msgs::{ErrorAction, LightningError};
use crate::ln::outbound_payment::{Bolt12PaymentError, OutboundPayments, PendingOutboundPayment, Retry, RetryableSendFailure, StaleExpiration};
#[cfg(feature = "std")]
use crate::events::{ClosureReason, Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentFailureReason, PaymentPurpose};
use crate::ln::channel::{EXPIRE_PREV_CONFIG_TICKS, get_holder_selected_channel_reserve_satoshis, ANCHOR_OUTPUT_VALUE_SATOSHI};
use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, MPP_TIMEOUT_TICKS, MIN_CLTV_EXPIRY_DELTA, PaymentId, PaymentSendFailure, RecentPaymentDetails, RecipientOnionFields, HTLCForwardInfo, PendingHTLCRouting, PendingAddHTLCInfo};
-use crate::ln::features::{Bolt11InvoiceFeatures, ChannelTypeFeatures};
+use crate::types::features::{Bolt11InvoiceFeatures, ChannelTypeFeatures};
use crate::ln::msgs;
use crate::ln::types::{ChannelId, PaymentHash, PaymentSecret, PaymentPreimage};
use crate::ln::chan_utils;
use crate::sign::{NodeSigner, Recipient};
use crate::events::{MessageSendEvent, MessageSendEventsProvider};
use crate::ln::types::ChannelId;
-use crate::ln::features::{InitFeatures, NodeFeatures};
+use crate::types::features::{InitFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::msgs::{ChannelMessageHandler, Init, LightningError, SocketAddress, OnionMessageHandler, RoutingMessageHandler};
use crate::util::ser::{VecWriter, Writeable, Writer};
use crate::events;
use crate::io;
use crate::ln::types::ChannelId;
- use crate::ln::features::{InitFeatures, NodeFeatures};
+ use crate::types::features::{InitFeatures, NodeFeatures};
use crate::ln::peer_channel_encryptor::PeerChannelEncryptor;
use crate::ln::peer_handler::{CustomMessageHandler, PeerManager, MessageHandler, SocketDescriptor, IgnoringMessageHandler, filter_addresses, ErroringMessageHandler, MAX_BUFFER_DRAIN_TICK_INTERVALS_PER_PEER};
use crate::ln::{msgs, wire};
use crate::ln::channelmanager::{MIN_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields};
use crate::routing::gossip::RoutingFees;
use crate::routing::router::{PaymentParameters, RouteHint, RouteHintHop};
-use crate::ln::features::ChannelTypeFeatures;
+use crate::types::features::ChannelTypeFeatures;
use crate::ln::msgs;
use crate::ln::types::ChannelId;
use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler, ChannelUpdate, ErrorAction};
use bitcoin::secp256k1::PublicKey;
use crate::ln::channelmanager;
-use crate::ln::features::InitFeatures;
+use crate::types::features::InitFeatures;
use crate::ln::msgs::DecodeError;
use crate::util::ser::{Readable, Writeable, Writer};
use bitcoin::secp256k1::Secp256k1;
use bitcoin::secp256k1::{PublicKey, SecretKey};
- use crate::ln::features::InitFeatures;
+ use crate::types::features::InitFeatures;
use crate::prelude::*;
fn pubkey() -> bitcoin::key::PublicKey {
use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
use crate::ln::types::PaymentHash;
use crate::ln::channelmanager::PaymentId;
-use crate::ln::features::{Bolt12InvoiceFeatures, InvoiceRequestFeatures, OfferFeatures};
+use crate::types::features::{Bolt12InvoiceFeatures, InvoiceRequestFeatures, OfferFeatures};
use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
use crate::ln::msgs::DecodeError;
use crate::offers::invoice_macros::{invoice_accessors_common, invoice_builder_methods_common};
use crate::blinded_path::BlindedHop;
use crate::blinded_path::message::BlindedMessagePath;
use crate::sign::KeyMaterial;
- use crate::ln::features::{Bolt12InvoiceFeatures, InvoiceRequestFeatures, OfferFeatures};
+ use crate::types::features::{Bolt12InvoiceFeatures, InvoiceRequestFeatures, OfferFeatures};
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::DecodeError;
use crate::offers::invoice_request::InvoiceRequestTlvStreamRef;
//!
//! use bitcoin::network::Network;
//! use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, SecretKey};
-//! use lightning::ln::features::OfferFeatures;
+//! use lightning::types::features::OfferFeatures;
//! use lightning::offers::invoice_request::UnsignedInvoiceRequest;
//! use lightning::offers::offer::Offer;
//! use lightning::util::ser::Writeable;
use crate::blinded_path::payment::BlindedPaymentPath;
use crate::ln::types::PaymentHash;
use crate::ln::channelmanager::PaymentId;
-use crate::ln::features::InvoiceRequestFeatures;
+use crate::types::features::InvoiceRequestFeatures;
use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
use crate::ln::msgs::DecodeError;
use crate::offers::merkle::{SignError, SignFn, SignatureTlvStream, SignatureTlvStreamRef, TaggedHash, self};
use core::time::Duration;
use crate::sign::KeyMaterial;
use crate::ln::channelmanager::PaymentId;
- use crate::ln::features::{InvoiceRequestFeatures, OfferFeatures};
+ use crate::types::features::{InvoiceRequestFeatures, OfferFeatures};
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::{DecodeError, MAX_VALUE_MSAT};
use crate::offers::invoice::{Bolt12Invoice, SIGNATURE_TAG as INVOICE_SIGNATURE_TAG};
use crate::io;
use crate::blinded_path::message::BlindedMessagePath;
use crate::ln::channelmanager::PaymentId;
-use crate::ln::features::OfferFeatures;
+use crate::types::features::OfferFeatures;
use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
use crate::ln::msgs::{DecodeError, MAX_VALUE_MSAT};
use crate::offers::merkle::{TaggedHash, TlvStream};
}
/// Features pertaining to the offer.
- pub fn offer_features(&$self) -> &$crate::ln::features::OfferFeatures {
+ pub fn offer_features(&$self) -> &$crate::types::features::OfferFeatures {
&$contents.features()
}
use crate::blinded_path::BlindedHop;
use crate::blinded_path::message::BlindedMessagePath;
use crate::sign::KeyMaterial;
- use crate::ln::features::OfferFeatures;
+ use crate::types::features::OfferFeatures;
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::{DecodeError, MAX_VALUE_MSAT};
use crate::offers::nonce::Nonce;
use crate::blinded_path::payment::BlindedPaymentPath;
use crate::ln::types::PaymentHash;
use crate::ln::channelmanager::PaymentId;
-use crate::ln::features::InvoiceRequestFeatures;
+use crate::types::features::InvoiceRequestFeatures;
use crate::ln::inbound_payment::{ExpandedKey, IV_LEN};
use crate::ln::msgs::{DecodeError, MAX_VALUE_MSAT};
use crate::offers::invoice_request::{InvoiceRequestTlvStream, InvoiceRequestTlvStreamRef};
use crate::blinded_path::message::BlindedMessagePath;
use crate::sign::KeyMaterial;
use crate::ln::channelmanager::PaymentId;
- use crate::ln::features::{InvoiceRequestFeatures, OfferFeatures};
+ use crate::types::features::{InvoiceRequestFeatures, OfferFeatures};
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::{DecodeError, MAX_VALUE_MSAT};
use crate::offers::invoice_request::InvoiceRequestTlvStreamRef;
use crate::blinded_path::message::BlindedMessagePath;
use crate::blinded_path::payment::BlindedPaymentPath;
use crate::io;
-use crate::ln::features::{Bolt12InvoiceFeatures, OfferFeatures};
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::DecodeError;
use crate::offers::invoice::{
Amount, Offer, OfferContents, OfferTlvStream, OfferTlvStreamRef, Quantity, OFFER_TYPES,
};
use crate::offers::parse::{Bolt12ParseError, Bolt12SemanticError, ParsedMessage};
+use crate::types::features::{Bolt12InvoiceFeatures, OfferFeatures};
use crate::util::ser::{CursorReadable, Iterable, WithoutLength, Writeable, Writer};
use crate::util::string::PrintableString;
use bitcoin::address::Address;
mod tests {
use crate::blinded_path::message::BlindedMessagePath;
use crate::blinded_path::BlindedHop;
- use crate::ln::features::{Bolt12InvoiceFeatures, OfferFeatures};
use crate::ln::inbound_payment::ExpandedKey;
use crate::ln::msgs::DecodeError;
use crate::offers::invoice::InvoiceTlvStreamRef;
};
use crate::offers::test_utils::*;
use crate::sign::KeyMaterial;
+ use crate::types::features::{Bolt12InvoiceFeatures, OfferFeatures};
use crate::util::ser::{BigSize, Iterable, Writeable};
use bitcoin::constants::ChainHash;
use bitcoin::secp256k1::{self, Secp256k1};
use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
use crate::sign::EntropySource;
use crate::ln::types::PaymentHash;
-use crate::ln::features::BlindedHopFeatures;
+use crate::types::features::BlindedHopFeatures;
use crate::offers::merkle::TaggedHash;
#[allow(unused_imports)]
use crate::blinded_path::EmptyNodeIdLookUp;
use crate::blinded_path::message::{AsyncPaymentsContext, BlindedMessagePath, DNSResolverContext, MessageForwardNode, MessageContext, OffersContext};
use crate::events::{Event, EventsProvider};
-use crate::ln::features::{ChannelFeatures, InitFeatures};
+use crate::types::features::{ChannelFeatures, InitFeatures};
use crate::ln::msgs::{self, DecodeError, OnionMessageHandler};
use crate::routing::gossip::{NetworkGraph, P2PGossipSync};
use crate::routing::test_utils::{add_channel, add_or_update_node};
use crate::blinded_path::utils;
use crate::events::{Event, EventHandler, EventsProvider, ReplayEvent};
use crate::sign::{EntropySource, NodeSigner, Recipient};
-use crate::ln::features::{InitFeatures, NodeFeatures};
+use crate::types::features::{InitFeatures, NodeFeatures};
use crate::ln::msgs::{self, OnionMessage, OnionMessageHandler, SocketAddress};
use crate::ln::onion_utils;
use crate::routing::gossip::{NetworkGraph, NodeId, ReadOnlyNetworkGraph};
use bitcoin::network::Network;
use crate::events::{MessageSendEvent, MessageSendEventsProvider};
-use crate::ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
use crate::ln::msgs;
use crate::ln::msgs::{
ChannelAnnouncement, ChannelUpdate, GossipTimestampFilter, NodeAnnouncement,
};
use crate::ln::types::ChannelId;
use crate::routing::utxo::{self, UtxoLookup, UtxoResolver};
+use crate::types::features::{ChannelFeatures, InitFeatures, NodeFeatures};
use crate::util::indexed_map::{Entry as IndexedMapEntry, IndexedMap};
use crate::util::logger::{Level, Logger};
use crate::util::scid_utils::{block_from_scid, scid_from_parts, MAX_SCID_BLOCK};
use crate::events::{MessageSendEvent, MessageSendEventsProvider};
use crate::ln::chan_utils::make_funding_redeemscript;
use crate::ln::channelmanager;
- #[cfg(feature = "std")]
- use crate::ln::features::InitFeatures;
use crate::ln::msgs::SocketAddress;
use crate::ln::msgs::{
ChannelAnnouncement, ChannelUpdate, NodeAnnouncement, QueryChannelRange,
MAX_EXCESS_BYTES_FOR_RELAY,
};
use crate::routing::utxo::{UtxoLookupError, UtxoResult};
+ #[cfg(feature = "std")]
+ use crate::types::features::InitFeatures;
use crate::util::config::UserConfig;
use crate::util::scid_utils::scid_from_parts;
use crate::util::ser::{Hostname, Readable, ReadableArgs, Writeable};
use crate::ln::{PaymentHash, PaymentPreimage};
use crate::ln::channel_state::ChannelDetails;
use crate::ln::channelmanager::{PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA, RecipientOnionFields};
-use crate::ln::features::{BlindedHopFeatures, Bolt11InvoiceFeatures, Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
+use crate::types::features::{BlindedHopFeatures, Bolt11InvoiceFeatures, Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures};
use crate::ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT};
use crate::ln::onion_utils;
#[cfg(async_payments)]
use crate::chain::transaction::OutPoint;
use crate::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState};
use crate::ln::types::ChannelId;
- use crate::ln::features::{BlindedHopFeatures, ChannelFeatures, InitFeatures, NodeFeatures};
+ use crate::types::features::{BlindedHopFeatures, ChannelFeatures, InitFeatures, NodeFeatures};
use crate::ln::msgs::{ErrorAction, LightningError, UnsignedChannelUpdate, MAX_VALUE_MSAT};
use crate::ln::channelmanager;
use crate::util::config::UserConfig;
use super::*;
use crate::routing::scoring::{ScoreUpdate, ScoreLookUp};
use crate::ln::channelmanager;
- use crate::ln::features::Bolt11InvoiceFeatures;
+ use crate::types::features::Bolt11InvoiceFeatures;
use crate::routing::gossip::NetworkGraph;
use crate::routing::scoring::{FixedPenaltyScorer, ProbabilisticScoringFeeParameters};
use crate::util::config::UserConfig;
use criterion::Criterion;
use crate::routing::router::{bench_utils, RouteHop};
use crate::util::test_utils::TestLogger;
- use crate::ln::features::{ChannelFeatures, NodeFeatures};
+ use crate::types::features::{ChannelFeatures, NodeFeatures};
pub fn decay_100k_channel_bounds(bench: &mut Criterion) {
let logger = TestLogger::new();
// licenses.
use crate::routing::gossip::{NetworkGraph, NodeAlias, P2PGossipSync};
-use crate::ln::features::{ChannelFeatures, NodeFeatures};
+use crate::types::features::{ChannelFeatures, NodeFeatures};
use crate::ln::msgs::{ChannelAnnouncement, ChannelUpdate, MAX_VALUE_MSAT, NodeAnnouncement, RoutingMessageHandler, SocketAddress, UnsignedChannelAnnouncement, UnsignedChannelUpdate, UnsignedNodeAnnouncement};
use crate::util::test_utils;
use crate::util::ser::Writeable;
use crate::crypto::chacha20::ChaCha20;
use crate::io::{self, Error};
-use crate::ln::features::ChannelTypeFeatures;
use crate::ln::msgs::DecodeError;
use crate::prelude::*;
use crate::sign::ecdsa::EcdsaChannelSigner;
#[cfg(taproot)]
use crate::sign::taproot::TaprootChannelSigner;
+use crate::types::features::ChannelTypeFeatures;
use crate::util::atomic_counter::AtomicCounter;
use core::convert::TryInto;
use core::ops::Deref;
/// a channel or cooperatively close one with this peer (and will have to force-close instead).
///
/// [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
- /// [`InitFeatures`]: crate::ln::features::InitFeatures
+ /// [`InitFeatures`]: crate::types::features::InitFeatures
IncompatibleShutdownScript {
/// The incompatible shutdown script.
script: ShutdownScript,
use crate::sign::HTLCDescriptor;
use crate::util::ser::{Writeable, Writer};
use crate::io::Error;
-use crate::ln::features::ChannelTypeFeatures;
+use crate::types::features::ChannelTypeFeatures;
#[cfg(taproot)]
use crate::ln::msgs::PartialSignatureWithNonce;
#[cfg(taproot)]
use crate::ln::channelmanager;
#[cfg(test)]
use crate::ln::chan_utils::CommitmentTransaction;
-use crate::ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
+use crate::types::features::{ChannelFeatures, InitFeatures, NodeFeatures};
use crate::ln::{msgs, wire};
use crate::ln::msgs::LightningError;
use crate::ln::script::ShutdownScript;