|
|
@ -4,6 +4,7 @@ import java.security.MessageDigest; |
|
|
|
|
|
|
|
public class Block { |
|
|
|
|
|
|
|
|
|
|
|
int data; |
|
|
|
int kontostand; |
|
|
|
Block vorher; |
|
|
@ -11,14 +12,39 @@ public class Block { |
|
|
|
String ownHash; |
|
|
|
String previousHash; |
|
|
|
|
|
|
|
public Block(int Data) { |
|
|
|
data = Data; |
|
|
|
vorher = null; |
|
|
|
public Block(int data, Block vorher, String previousHash, int konto) { |
|
|
|
this.data = data; |
|
|
|
ownHash = createNewHash(); |
|
|
|
previousHash = null; |
|
|
|
|
|
|
|
kontostand = konto + this.data; |
|
|
|
|
|
|
|
this.vorher = vorher; |
|
|
|
this.previousHash = previousHash; |
|
|
|
} |
|
|
|
|
|
|
|
public Block(int data) { |
|
|
|
this.data = data; |
|
|
|
ownHash = createNewHash(); |
|
|
|
|
|
|
|
kontostand = this.data; |
|
|
|
|
|
|
|
this.vorher = null; |
|
|
|
this.previousHash = null; |
|
|
|
} |
|
|
|
|
|
|
|
private String createNewHash() { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public int getKontostand() { |
|
|
|
return kontostand; |
|
|
|
} |
|
|
|
|
|
|
|
public Block getVorher() { |
|
|
|
return vorher; |
|
|
|
} |
|
|
|
|
|
|
|
public String getHash() { |
|
|
|
return ownHash; |
|
|
|
} |
|
|
|
} |