@@ -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 ;
@@ -199,24 +197,14 @@ impl Sign for EnforcingSigner {}
199197
200198impl Writeable for EnforcingSigner {
201199 fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
200+ // NOTE: This will be de-serialized by KeysInterface::read_chan_signer
201+ // and it expects to see just the InMemorySigner. The enforcement state is managed
202+ // by KeysInterface, so we don't serialize it here.
202203 self . inner . write ( writer) ?;
203- // NOTE - the commitment state is maintained by KeysInterface, so we don't persist it
204204 Ok ( ( ) )
205205 }
206206}
207207
208- impl Readable for EnforcingSigner {
209- fn read < R : io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
210- let inner = Readable :: read ( reader) ?;
211- let state = Arc :: new ( Mutex :: new ( EnforcementState :: new ( ) ) ) ;
212- Ok ( EnforcingSigner {
213- inner,
214- state,
215- disable_revocation_policy_check : false ,
216- } )
217- }
218- }
219-
220208impl EnforcingSigner {
221209 fn verify_counterparty_commitment_tx < ' a , T : secp256k1:: Signing + secp256k1:: Verification > ( & self , commitment_tx : & ' a CommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> TrustedCommitmentTransaction < ' a > {
222210 commitment_tx. verify ( & self . inner . get_channel_parameters ( ) . as_counterparty_broadcastable ( ) ,
0 commit comments