Skip to content

last_hash = block.hash.clone(); #4

@moaiad1

Description

@moaiad1

thanks for your efforts and time , I have a warrning when I run cargo as it couldn't read last hash I couldn't figure the issue that cause the problem as well as Failed to add block: InsufficientInputValue' where should the value stored:
please check the result

warning: value assigned to last_hash is never read
--> src/main.rs:63:5
|
63 | last_hash = block.hash.clone();
| ^^^^^^^^^
|
= note: #[warn(unused_assignments)] on by default
= help: maybe it is overwritten before being read?

warning: hash (bin "blockchain") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.12s
Running target/debug/blockchain
Mined genesis block Block[0]: e2937e782fc68a1a0f8f71830f69919136139f6f956fda1e6999f57327070100 at: 1651809036733 with: 1 nonce: 3458
Mined block Block[1]: cb8add22253b754895c232b4ca65f57dcbb42b1ebdb5bd80242e4fdea6b50500 at: 1651809036998 with: 2 nonce: 4312
thread 'main' panicked at 'Failed to add block: InsufficientInputValue', src/main.rs:65:41
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

thanks for the nice topic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions