X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Fenforcing_trait_impls.rs;h=baa9e7cd16d98b05be00abcf5d7ebc46a75cbbf8;hb=efa579bc61eafaae509657e57c6442c0c9229915;hp=32c17af64dd877efcd8c07a7698e0049bdc739bd;hpb=3a0356fe308ba29916d00f3376cd57ce6613f3d0;p=rust-lightning diff --git a/lightning/src/util/enforcing_trait_impls.rs b/lightning/src/util/enforcing_trait_impls.rs index 32c17af6..baa9e7cd 100644 --- a/lightning/src/util/enforcing_trait_impls.rs +++ b/lightning/src/util/enforcing_trait_impls.rs @@ -11,8 +11,10 @@ use ln::chan_utils::{HTLCOutputInCommitment, ChannelPublicKeys, HolderCommitment use ln::{chan_utils, msgs}; use chain::keysinterface::{Sign, InMemorySigner, BaseSign}; +use io; +use prelude::*; use core::cmp; -use std::sync::{Mutex, Arc}; +use sync::{Mutex, Arc}; use bitcoin::blockdata::transaction::{Transaction, SigHashType}; use bitcoin::util::bip143; @@ -21,7 +23,7 @@ use bitcoin::secp256k1; use bitcoin::secp256k1::key::{SecretKey, PublicKey}; use bitcoin::secp256k1::{Secp256k1, Signature}; use util::ser::{Writeable, Writer, Readable}; -use std::io::Error; +use io::Error; use ln::msgs::DecodeError; /// Initial value for revoked commitment downward counter @@ -38,6 +40,9 @@ pub const INITIAL_REVOKED_COMMITMENT_NUMBER: u64 = 1 << 48; /// /// Eventually we will probably want to expose a variant of this which would essentially /// be what you'd want to run on a hardware wallet. +/// +/// Note that before we do so we should ensure its serialization format has backwards- and +/// forwards-compatibility prefix/suffixes! #[derive(Clone)] pub struct EnforcingSigner { pub inner: InMemorySigner, @@ -177,7 +182,7 @@ impl Writeable for EnforcingSigner { } impl Readable for EnforcingSigner { - fn read(reader: &mut R) -> Result { + fn read(reader: &mut R) -> Result { let inner = Readable::read(reader)?; let last_commitment_number = Readable::read(reader)?; Ok(EnforcingSigner {