We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e47620 + f576ffd commit a40ba47Copy full SHA for a40ba47
src/noobchain/Block.java
@@ -46,7 +46,7 @@ public void mineBlock(int difficulty) {
46
public boolean addTransaction(Transaction transaction) {
47
//process transaction and check if valid, unless block is genesis block then ignore.
48
if(transaction == null) return false;
49
- if((previousHash != "0")) {
+ if((!"0".equals(previousHash))) {
50
if((transaction.processTransaction() != true)) {
51
System.out.println("Transaction failed to process. Discarded.");
52
return false;
0 commit comments