Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Mining a Block in Java for toutsurlebitcoin.fr
public void mineBlock(int difficulty) {
nonce = 0;
while (!getHash().substring(0, difficulty).equals(Utils.zeros(difficulty))) {
nonce++;
hash = Block.calculateHash(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment