Struct library_blockchain::blockchain::Blockchain
source · [−]Expand description
Collection of related blocks as the same as linked lists In this program logic of POW algorithm have used.
Fields
blocks: Vec<Block>
Implementations
sourceimpl Blockchain
impl Blockchain
pub fn new() -> Self
sourcepub fn blockchain_update_with_block(
&mut self,
block: Block
) -> Result<&Vec<Block>, CustomError>
pub fn blockchain_update_with_block(
&mut self,
block: Block
) -> Result<&Vec<Block>, CustomError>
In the update_with_block() checking for (+)Overspending, (+)Double Spending, (-)Impersonate.
Define BlockValidationError for violation of the rules POW
Call input and output hash function
Retain unspent_outputs of the Blockchain
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Blockchain
impl Send for Blockchain
impl Sync for Blockchain
impl Unpin for Blockchain
impl UnwindSafe for Blockchain
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more