pub struct BlockchainNode {
pub block: Block,
pub total_work: Uint256,
pub required_difficulty: Uint256,
pub height: u32,
pub has_txdata: bool,
/* private fields */
}
Expand description
A link in the blockchain
Fields§
§block: Block
The actual block
total_work: Uint256
Total work from genesis to this point
required_difficulty: Uint256
Expected value of block.header.bits
for this block; only changes every
blockdata::constants::DIFFCHANGE_INTERVAL;
blocks
height: u32
Height above genesis
has_txdata: bool
Whether the transaction data is stored
Implementations§
Source§impl BlockchainNode
impl BlockchainNode
Sourcepub fn is_on_main_chain(&self, chain: &Blockchain) -> bool
pub fn is_on_main_chain(&self, chain: &Blockchain) -> bool
Is the node on the main chain?
Trait Implementations§
Source§impl BitcoinHash for BlockchainNode
impl BitcoinHash for BlockchainNode
Source§fn bitcoin_hash(&self) -> Sha256dHash
fn bitcoin_hash(&self) -> Sha256dHash
Produces a Sha256dHash which can be used to refer to the object
Source§impl<D: Decoder> Decodable<D> for BlockchainNode
impl<D: Decoder> Decodable<D> for BlockchainNode
Source§fn consensus_decode(d: &mut D) -> Result<BlockchainNode, Error>where
D: Decoder,
fn consensus_decode(d: &mut D) -> Result<BlockchainNode, Error>where
D: Decoder,
Decode an object with a well-defined format
Source§impl<S: Encoder> Encodable<S> for BlockchainNode
impl<S: Encoder> Encodable<S> for BlockchainNode
impl Send for BlockchainNode
Auto Trait Implementations§
impl Freeze for BlockchainNode
impl RefUnwindSafe for BlockchainNode
impl !Sync for BlockchainNode
impl Unpin for BlockchainNode
impl UnwindSafe for BlockchainNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more