Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public void addBlock(Block block) throws NoSuchAlgorithmException {
block.previousBlockHash = chain.size() == 0 ? CryptoHelper.sha256("0") : chain.get(chain.size()-1).getHash();
// before adding a block to the blockchain
// mine block for the magic nonce value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.