Here, let's split up the createNewTransaction method into two separate methods, by modifying it as follows:
- Go to the createNewTransaction method in your dev/blockchain.js file. We built this method in Chapter 2, Building a Blockchain in the Creating createNewTransaction method section. For reference, take a look at the following createNewTransaction method:
Blockchain.prototype.createNewTransaction = function (amount, sender, recipient) { const newTransaction = { amount: amount, sender: sender, recipient: recipient, }; this.newTransactions.push(newTransaction); return.this.getlastBlock() ['index'] + 1;}
- Let's make the following highlighted modifications to the method:
Blockchain.prototype.createNewTransaction ...