src/main/Blockchain.java
public void addBlock(Block blockToAdd){        
        blockToAdd.previousHash = blockChain.get(blockChain.size()-1).hash;
        if(blockToAdd.mineBlock(DIFFICULTY)){
            blockChain.add(blockToAdd);
        }
    }
// current tail of the blockchain and then mining the block
current tail of the blockchain and then mining the block
current tail of the blockchain and then mining the block
public void addBlock(Block blockToAdd){        
        blockToAdd.previousHash = blockChain.get(blockChain.size()-1).hash;
        if(blockToAdd.mineBlock(DIFFICULTY)){
            blockChain.add(blockToAdd);
        }
    }
public void addBlock ( Block blockToAdd ) { blockToAdd . previousHash = blockChain . get ( blockChain . size ( ) - 1 ) . hash ; if ( blockToAdd . mineBlock ( DIFFICULTY ) ) { blockChain . add ( blockToAdd ) ; } }
current tail of the blockchain and then mining the block
current tail of the blockchain and then mining the block