Fix for rustc RFC 1214; also add missing docs
This commit is contained in:
parent
00421970a1
commit
14db7ee902
|
@ -31,10 +31,15 @@ use util::misc::hex_bytes;
|
||||||
use util::hash::MerkleRoot;
|
use util::hash::MerkleRoot;
|
||||||
use util::uint::Uint256;
|
use util::uint::Uint256;
|
||||||
|
|
||||||
|
/// The maximum allowable sequence number
|
||||||
pub static MAX_SEQUENCE: u32 = 0xFFFFFFFF;
|
pub static MAX_SEQUENCE: u32 = 0xFFFFFFFF;
|
||||||
|
/// How many satoshis are in "one bitcoin"
|
||||||
pub static COIN_VALUE: u64 = 100_000_000;
|
pub static COIN_VALUE: u64 = 100_000_000;
|
||||||
|
/// How many seconds between blocks we expect on average
|
||||||
pub static TARGET_BLOCK_SPACING: u32 = 600;
|
pub static TARGET_BLOCK_SPACING: u32 = 600;
|
||||||
|
/// How many blocks between diffchanges
|
||||||
pub static DIFFCHANGE_INTERVAL: u32 = 2016;
|
pub static DIFFCHANGE_INTERVAL: u32 = 2016;
|
||||||
|
/// How much time on average should occur between diffchanges
|
||||||
pub static DIFFCHANGE_TIMESPAN: u32 = 14 * 24 * 3600;
|
pub static DIFFCHANGE_TIMESPAN: u32 = 14 * 24 * 3600;
|
||||||
|
|
||||||
/// In Bitcoind this is insanely described as ~((u256)0 >> 32)
|
/// In Bitcoind this is insanely described as ~((u256)0 >> 32)
|
||||||
|
|
|
@ -32,8 +32,11 @@ user_enum! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Version of the protocol as appearing in network message headers
|
||||||
pub const PROTOCOL_VERSION: u32 = 70001;
|
pub const PROTOCOL_VERSION: u32 = 70001;
|
||||||
|
/// Bitfield of services provided by this node
|
||||||
pub const SERVICES: u64 = 0;
|
pub const SERVICES: u64 = 0;
|
||||||
|
/// User agent as it appears in the version message
|
||||||
pub const USER_AGENT: &'static str = "bitcoin-rust v0.1";
|
pub const USER_AGENT: &'static str = "bitcoin-rust v0.1";
|
||||||
|
|
||||||
/// Return the network magic bytes, which should be encoded little-endian
|
/// Return the network magic bytes, which should be encoded little-endian
|
||||||
|
|
|
@ -37,13 +37,13 @@ use util::hash::Sha256dHash;
|
||||||
use network::serialize::{SimpleDecoder, SimpleEncoder};
|
use network::serialize::{SimpleDecoder, SimpleEncoder};
|
||||||
|
|
||||||
/// Data which can be encoded in a consensus-consistent way
|
/// Data which can be encoded in a consensus-consistent way
|
||||||
pub trait ConsensusEncodable<S: SimpleEncoder> {
|
pub trait ConsensusEncodable<S: SimpleEncoder> : Sized {
|
||||||
/// Encode an object with a well-defined format
|
/// Encode an object with a well-defined format
|
||||||
fn consensus_encode(&self, e: &mut S) -> Result<(), S::Error>;
|
fn consensus_encode(&self, e: &mut S) -> Result<(), S::Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Data which can be encoded in a consensus-consistent way
|
/// Data which can be encoded in a consensus-consistent way
|
||||||
pub trait ConsensusDecodable<D: SimpleDecoder> {
|
pub trait ConsensusDecodable<D: SimpleDecoder>: Sized {
|
||||||
/// Decode an object with a well-defined format
|
/// Decode an object with a well-defined format
|
||||||
fn consensus_decode(d: &mut D) -> Result<Self, D::Error>;
|
fn consensus_decode(d: &mut D) -> Result<Self, D::Error>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl<I: Iterator> Pair<I> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator that returns elements of the original iterator 2 at a time
|
/// Returns an iterator that returns elements of the original iterator 2 at a time
|
||||||
pub trait Pairable {
|
pub trait Pairable : Sized {
|
||||||
/// Returns an iterator that returns elements of the original iterator 2 at a time
|
/// Returns an iterator that returns elements of the original iterator 2 at a time
|
||||||
fn pair(self) -> Pair<Self>;
|
fn pair(self) -> Pair<Self>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue