Fix typos
This commit is contained in:
parent
96be35b1d3
commit
132ca5ea95
|
@ -243,7 +243,7 @@ fn build_scriptint(n: i64) -> Vec<u8> {
|
||||||
/// This is a bit crazy and subtle, but it makes sense: you can load
|
/// This is a bit crazy and subtle, but it makes sense: you can load
|
||||||
/// 32-bit numbers and do anything with them, which back when mult/div
|
/// 32-bit numbers and do anything with them, which back when mult/div
|
||||||
/// was allowed, could result in up to a 64-bit number. We don't want
|
/// was allowed, could result in up to a 64-bit number. We don't want
|
||||||
/// overflow since that's suprising --- and we don't want numbers that
|
/// overflow since that's surprising --- and we don't want numbers that
|
||||||
/// don't fit in 64 bits (for efficiency on modern processors) so we
|
/// don't fit in 64 bits (for efficiency on modern processors) so we
|
||||||
/// simply say, anything in excess of 32 bits is no longer a number.
|
/// simply say, anything in excess of 32 bits is no longer a number.
|
||||||
/// This is basically a ranged type implementation.
|
/// This is basically a ranged type implementation.
|
||||||
|
|
|
@ -232,7 +232,7 @@ impl Default for TxOut {
|
||||||
/// However, in protocols where transactions may legitimately have 0 inputs, e.g.
|
/// However, in protocols where transactions may legitimately have 0 inputs, e.g.
|
||||||
/// when parties are cooperatively funding a transaction, the "00 means Segwit"
|
/// when parties are cooperatively funding a transaction, the "00 means Segwit"
|
||||||
/// heuristic does not work. Since Segwit requires such a transaction be encoded
|
/// heuristic does not work. Since Segwit requires such a transaction be encoded
|
||||||
/// in the the original transaction format (since it has no inputs and therefore
|
/// in the original transaction format (since it has no inputs and therefore
|
||||||
/// no input witnesses), a traditionally encoded transaction may have the `0001`
|
/// no input witnesses), a traditionally encoded transaction may have the `0001`
|
||||||
/// Segwit flag in it, which confuses most Segwit parsers including the one in
|
/// Segwit flag in it, which confuses most Segwit parsers including the one in
|
||||||
/// Bitcoin Core.
|
/// Bitcoin Core.
|
||||||
|
|
|
@ -61,7 +61,7 @@ pub struct Params {
|
||||||
pub rule_change_activation_threshold: u32,
|
pub rule_change_activation_threshold: u32,
|
||||||
/// Number of blocks with the same set of rules.
|
/// Number of blocks with the same set of rules.
|
||||||
pub miner_confirmation_window: u32,
|
pub miner_confirmation_window: u32,
|
||||||
/// Proof of work limit value. It cointans the lowest possible difficulty.
|
/// Proof of work limit value. It contains the lowest possible difficulty.
|
||||||
pub pow_limit: Uint256,
|
pub pow_limit: Uint256,
|
||||||
/// Expected amount of time to mine one block.
|
/// Expected amount of time to mine one block.
|
||||||
pub pow_target_spacing: u64,
|
pub pow_target_spacing: u64,
|
||||||
|
|
|
@ -138,7 +138,7 @@ macro_rules! impl_array_newtype {
|
||||||
// manually implement comparison to get little-endian ordering
|
// manually implement comparison to get little-endian ordering
|
||||||
// (we need this for our numeric types; non-numeric ones shouldn't
|
// (we need this for our numeric types; non-numeric ones shouldn't
|
||||||
// be ordered anyway except to put them in BTrees or whatever, and
|
// be ordered anyway except to put them in BTrees or whatever, and
|
||||||
// they don't care how we order as long as we're consisistent).
|
// they don't care how we order as long as we're consistent).
|
||||||
for i in 0..$len {
|
for i in 0..$len {
|
||||||
if self[$len - 1 - i] < other[$len - 1 - i] { return ::std::cmp::Ordering::Less; }
|
if self[$len - 1 - i] < other[$len - 1 - i] { return ::std::cmp::Ordering::Less; }
|
||||||
if self[$len - 1 - i] > other[$len - 1 - i] { return ::std::cmp::Ordering::Greater; }
|
if self[$len - 1 - i] > other[$len - 1 - i] { return ::std::cmp::Ordering::Greater; }
|
||||||
|
|
|
@ -74,7 +74,7 @@ pub struct RawNetworkMessage {
|
||||||
pub enum SocketResponse {
|
pub enum SocketResponse {
|
||||||
/// A message was received
|
/// A message was received
|
||||||
MessageReceived(NetworkMessage),
|
MessageReceived(NetworkMessage),
|
||||||
/// An error occured and the socket needs to close
|
/// An error occurred and the socket needs to close
|
||||||
ConnectionFailed(util::Error, Sender<()>)
|
ConnectionFailed(util::Error, Sender<()>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ pub struct VersionMessage {
|
||||||
pub nonce: u64,
|
pub nonce: u64,
|
||||||
/// A string describing the peer's software
|
/// A string describing the peer's software
|
||||||
pub user_agent: String,
|
pub user_agent: String,
|
||||||
/// The height of the maxmimum-work blockchain that the peer is aware of
|
/// The height of the maximum-work blockchain that the peer is aware of
|
||||||
pub start_height: i32,
|
pub start_height: i32,
|
||||||
/// Whether the receiving peer should relay messages to the sender; used
|
/// Whether the receiving peer should relay messages to the sender; used
|
||||||
/// if the sender is bandwidth-limited and would like to support bloom
|
/// if the sender is bandwidth-limited and would like to support bloom
|
||||||
|
|
|
@ -129,7 +129,7 @@ impl Address {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a witness pay to public key address from a public key
|
/// Create a witness pay to public key address from a public key
|
||||||
/// This is the native segwit address type for an output redemable with a single signature
|
/// This is the native segwit address type for an output redeemable with a single signature
|
||||||
pub fn p2wpkh (pk: &PublicKey, network: Network) -> Address {
|
pub fn p2wpkh (pk: &PublicKey, network: Network) -> Address {
|
||||||
Address {
|
Address {
|
||||||
network: network,
|
network: network,
|
||||||
|
|
|
@ -192,7 +192,7 @@ impl serde::Serialize for ChildNumber {
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// A pk->pk derivation was attempted on a hardened key
|
/// A pk->pk derivation was attempted on a hardened key
|
||||||
CannotDeriveFromHardenedKey,
|
CannotDeriveFromHardenedKey,
|
||||||
/// A secp256k1 error occured
|
/// A secp256k1 error occurred
|
||||||
Ecdsa(secp256k1::Error),
|
Ecdsa(secp256k1::Error),
|
||||||
/// A child number was provided that was out of range
|
/// A child number was provided that was out of range
|
||||||
InvalidChildNumber(ChildNumber),
|
InvalidChildNumber(ChildNumber),
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
//! Pay-to-contract-hash supporte
|
//! Pay-to-contract-hash support
|
||||||
//!
|
//!
|
||||||
//! See Appendix A of the Blockstream sidechains whitepaper
|
//! See Appendix A of the Blockstream sidechains whitepaper
|
||||||
//! at http://blockstream.com/sidechains.pdf for details of
|
//! at http://blockstream.com/sidechains.pdf for details of
|
||||||
|
@ -32,7 +32,7 @@ use util::{address, hash};
|
||||||
#[cfg(feature="fuzztarget")] use fuzz_util::sha2;
|
#[cfg(feature="fuzztarget")] use fuzz_util::sha2;
|
||||||
#[cfg(not(feature="fuzztarget"))] use crypto::sha2;
|
#[cfg(not(feature="fuzztarget"))] use crypto::sha2;
|
||||||
|
|
||||||
/// Encoding of "pubkey here" in script; from bitcoin core `src/script/script.h`
|
/// Encoding of "pubkey here" in script; from Bitcoin Core `src/script/script.h`
|
||||||
static PUBKEY: u8 = 0xFE;
|
static PUBKEY: u8 = 0xFE;
|
||||||
|
|
||||||
/// A contract-hash error
|
/// A contract-hash error
|
||||||
|
|
|
@ -60,7 +60,7 @@ pub fn hex_bytes(data: &str) -> Result<Vec<u8>, encode::Error> {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert bytes representing characters to their represented value and combine lsn and msn.
|
// Convert bytes representing characters to their represented value and combine lsn and msn.
|
||||||
// The and_then and map are crucial for performance, in comparision to using ? and then
|
// The and_then and map are crucial for performance, in comparison to using ? and then
|
||||||
// using the results of that for the calculation it's nearly twice as fast. Using bit
|
// using the results of that for the calculation it's nearly twice as fast. Using bit
|
||||||
// shifting and or instead of multiply and add on the other hand doesn't show a significant
|
// shifting and or instead of multiply and add on the other hand doesn't show a significant
|
||||||
// increase in performance.
|
// increase in performance.
|
||||||
|
|
|
@ -51,7 +51,7 @@ pub trait BitArray {
|
||||||
/// Create all-zeros value
|
/// Create all-zeros value
|
||||||
fn zero() -> Self;
|
fn zero() -> Self;
|
||||||
|
|
||||||
/// Create value represeting one
|
/// Create value representing one
|
||||||
fn one() -> Self;
|
fn one() -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue