@@ -11,7 +11,6 @@ use ln::chan_utils::{HTLCOutputInCommitment, ChannelPublicKeys, HolderCommitment
1111use ln:: { chan_utils, msgs} ;
1212use chain:: keysinterface:: { Sign , InMemorySigner , BaseSign } ;
1313
14- use io;
1514use prelude:: * ;
1615use core:: cmp;
1716use sync:: { Mutex , Arc } ;
@@ -23,9 +22,8 @@ use bitcoin::util::bip143;
2322use bitcoin:: secp256k1;
2423use bitcoin:: secp256k1:: key:: { SecretKey , PublicKey } ;
2524use bitcoin:: secp256k1:: { Secp256k1 , Signature } ;
26- use util:: ser:: { Writeable , Writer , Readable } ;
25+ use util:: ser:: { Writeable , Writer } ;
2726use io:: Error ;
28- use ln:: msgs:: DecodeError ;
2927
3028/// Initial value for revoked commitment downward counter
3129pub const INITIAL_REVOKED_COMMITMENT_NUMBER : u64 = 1 << 48 ;
@@ -194,24 +192,14 @@ impl Sign for EnforcingSigner {}
194192
195193impl Writeable for EnforcingSigner {
196194 fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
195+ // NOTE: This will be de-serialized by KeysInterface::read_chan_signer
196+ // and it expects to see just the InMemorySigner. The enforcement state is managed
197+ // by KeysInterface, so we don't serialize it here.
197198 self . inner . write ( writer) ?;
198- // NOTE - the commitment state is maintained by KeysInterface, so we don't persist it
199199 Ok ( ( ) )
200200 }
201201}
202202
203- impl Readable for EnforcingSigner {
204- fn read < R : io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
205- let inner = Readable :: read ( reader) ?;
206- let state = Arc :: new ( Mutex :: new ( EnforcementState :: new ( ) ) ) ;
207- Ok ( EnforcingSigner {
208- inner,
209- state,
210- disable_revocation_policy_check : false ,
211- } )
212- }
213- }
214-
215203impl EnforcingSigner {
216204 fn verify_counterparty_commitment_tx < ' a , T : secp256k1:: Signing + secp256k1:: Verification > ( & self , commitment_tx : & ' a CommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> TrustedCommitmentTransaction < ' a > {
217205 commitment_tx. verify ( & self . inner . get_channel_parameters ( ) . as_counterparty_broadcastable ( ) ,
0 commit comments