* @param {number} timestamp * @param {Transaction[]} transactions * @param {string} previousHash
(timestamp, transactions, previousHash = '')
| 79 | * @param {string} previousHash |
| 80 | */ |
| 81 | constructor(timestamp, transactions, previousHash = '') { |
| 82 | this.previousHash = previousHash; |
| 83 | this.timestamp = timestamp; |
| 84 | this.transactions = transactions; |
| 85 | this.nonce = 0; |
| 86 | this.hash = this.calculateHash(); |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Returns the SHA256 of this block (by processing all the data stored |
nothing calls this directly
no test coverage detected