@@ -58,12 +58,10 @@ use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
5858use crate :: ln:: script:: ShutdownScript ;
5959use crate :: offers:: invoice:: UnsignedBolt12Invoice ;
6060use crate :: types:: payment:: PaymentPreimage ;
61- use crate :: util:: ser:: { Readable , ReadableArgs , Writeable , Writer } ;
61+ use crate :: util:: ser:: Writeable ;
6262use crate :: util:: transaction_utils;
6363
6464use crate :: crypto:: chacha20:: ChaCha20 ;
65- use crate :: io:: { self , Error } ;
66- use crate :: ln:: msgs:: DecodeError ;
6765use crate :: prelude:: * ;
6866use crate :: sign:: ecdsa:: EcdsaChannelSigner ;
6967#[ cfg( taproot) ]
@@ -811,8 +809,7 @@ pub trait ChannelSigner {
811809 ///
812810 /// This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
813811 /// instance, LDK will call this method exactly once - either immediately after construction
814- /// (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
815- /// information has been generated.
812+ /// or when the funding information has been generated.
816813 ///
817814 /// channel_parameters.is_populated() MUST be true.
818815 fn provide_channel_parameters ( & mut self , channel_parameters : & ChannelTransactionParameters ) ;
@@ -983,21 +980,6 @@ pub trait SignerProvider {
983980 & self , channel_value_satoshis : u64 , channel_keys_id : [ u8 ; 32 ] ,
984981 ) -> Self :: EcdsaSigner ;
985982
986- /// Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
987- /// This is only called during deserialization of other objects which contain
988- /// [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
989- /// The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
990- /// contain no versioning scheme. You may wish to include your own version prefix and ensure
991- /// you've read all of the provided bytes to ensure no corruption occurred.
992- ///
993- /// This method is slowly being phased out -- it will only be called when reading objects
994- /// written by LDK versions prior to 0.0.113.
995- ///
996- /// [`Signer`]: Self::EcdsaSigner
997- /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
998- /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
999- fn read_chan_signer ( & self , reader : & [ u8 ] ) -> Result < Self :: EcdsaSigner , DecodeError > ;
1000-
1001983 /// Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
1002984 ///
1003985 /// If this function returns an error, this will result in a channel failing to open.
@@ -1790,74 +1772,6 @@ impl TaprootChannelSigner for InMemorySigner {
17901772 }
17911773}
17921774
1793- const SERIALIZATION_VERSION : u8 = 1 ;
1794-
1795- const MIN_SERIALIZATION_VERSION : u8 = 1 ;
1796-
1797- impl Writeable for InMemorySigner {
1798- fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
1799- write_ver_prefix ! ( writer, SERIALIZATION_VERSION , MIN_SERIALIZATION_VERSION ) ;
1800-
1801- self . funding_key . write ( writer) ?;
1802- self . revocation_base_key . write ( writer) ?;
1803- self . payment_key . write ( writer) ?;
1804- self . delayed_payment_base_key . write ( writer) ?;
1805- self . htlc_base_key . write ( writer) ?;
1806- self . commitment_seed . write ( writer) ?;
1807- self . channel_parameters . write ( writer) ?;
1808- self . channel_value_satoshis . write ( writer) ?;
1809- self . channel_keys_id . write ( writer) ?;
1810-
1811- write_tlv_fields ! ( writer, { } ) ;
1812-
1813- Ok ( ( ) )
1814- }
1815- }
1816-
1817- impl < ES : Deref > ReadableArgs < ES > for InMemorySigner
1818- where
1819- ES :: Target : EntropySource ,
1820- {
1821- fn read < R : io:: Read > ( reader : & mut R , entropy_source : ES ) -> Result < Self , DecodeError > {
1822- let _ver = read_ver_prefix ! ( reader, SERIALIZATION_VERSION ) ;
1823-
1824- let funding_key = Readable :: read ( reader) ?;
1825- let revocation_base_key = Readable :: read ( reader) ?;
1826- let payment_key = Readable :: read ( reader) ?;
1827- let delayed_payment_base_key = Readable :: read ( reader) ?;
1828- let htlc_base_key = Readable :: read ( reader) ?;
1829- let commitment_seed = Readable :: read ( reader) ?;
1830- let counterparty_channel_data = Readable :: read ( reader) ?;
1831- let channel_value_satoshis = Readable :: read ( reader) ?;
1832- let secp_ctx = Secp256k1 :: signing_only ( ) ;
1833- let holder_channel_pubkeys = InMemorySigner :: make_holder_keys (
1834- & secp_ctx,
1835- & funding_key,
1836- & revocation_base_key,
1837- & payment_key,
1838- & delayed_payment_base_key,
1839- & htlc_base_key,
1840- ) ;
1841- let keys_id = Readable :: read ( reader) ?;
1842-
1843- read_tlv_fields ! ( reader, { } ) ;
1844-
1845- Ok ( InMemorySigner {
1846- funding_key,
1847- revocation_base_key,
1848- payment_key,
1849- delayed_payment_base_key,
1850- htlc_base_key,
1851- commitment_seed,
1852- channel_value_satoshis,
1853- holder_channel_pubkeys,
1854- channel_parameters : counterparty_channel_data,
1855- channel_keys_id : keys_id,
1856- entropy_source : RandomBytes :: new ( entropy_source. get_secure_random_bytes ( ) ) ,
1857- } )
1858- }
1859- }
1860-
18611775/// Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
18621776/// 32-byte seed for use as a BIP 32 extended key and derives keys from that.
18631777///
@@ -2296,10 +2210,6 @@ impl SignerProvider for KeysManager {
22962210 self . derive_channel_keys ( channel_value_satoshis, & channel_keys_id)
22972211 }
22982212
2299- fn read_chan_signer ( & self , reader : & [ u8 ] ) -> Result < Self :: EcdsaSigner , DecodeError > {
2300- InMemorySigner :: read ( & mut io:: Cursor :: new ( reader) , self )
2301- }
2302-
23032213 fn get_destination_script ( & self , _channel_keys_id : [ u8 ; 32 ] ) -> Result < ScriptBuf , ( ) > {
23042214 Ok ( self . destination_script . clone ( ) )
23052215 }
@@ -2429,10 +2339,6 @@ impl SignerProvider for PhantomKeysManager {
24292339 self . inner . derive_channel_signer ( channel_value_satoshis, channel_keys_id)
24302340 }
24312341
2432- fn read_chan_signer ( & self , reader : & [ u8 ] ) -> Result < Self :: EcdsaSigner , DecodeError > {
2433- self . inner . read_chan_signer ( reader)
2434- }
2435-
24362342 fn get_destination_script ( & self , channel_keys_id : [ u8 ; 32 ] ) -> Result < ScriptBuf , ( ) > {
24372343 self . inner . get_destination_script ( channel_keys_id)
24382344 }
0 commit comments