Next, we need to push the newTransaction that was returned to the pendingTransactions array of the blockchain. Therefore, let's create another method, called addTransactionToPendingTransactions:
- In the dev/blockchain.js file, the addTransactionToPendingTransactions method will be defined as follows:
Blockchain.prototype.addTransactionToPendingTransactions = function(transactionObj) {};
- Next, take the transactionObj and push it to the pendingTransactions array of the blockchain:
Blockchain.prototype.addTransactionToPendingTransaction = function(transactionObj) { this.pendingTransactions.push(transactionObj);};
- Then, we simply want to return the index of the block to which the ...