* Returns the SHA256 of this block (by processing all the data stored * inside this block) * * @returns {string}
()
| 93 | * @returns {string} |
| 94 | */ |
| 95 | calculateHash() { |
| 96 | return crypto |
| 97 | .createHash('sha256') |
| 98 | .update( |
| 99 | this.previousHash + |
| 100 | this.timestamp + |
| 101 | JSON.stringify(this.transactions) + |
| 102 | this.nonce |
| 103 | ) |
| 104 | .digest('hex'); |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Starts the mining process on the block. It changes the 'nonce' until the hash |
no outgoing calls
no test coverage detected