const Wallet = require('../wallet'); const Transaction = require('../wallet/transaction'); class Miner { constructor(blockchain, transactionPool, wallet, p2pServer) { this.blockchain = blockchain; this.transactionPool = transactionPool; this.wallet = wallet; this.p2pServer = p2pServer; } mine() { const validTransactions = this.transactionPool.validTransactions(); validTransactions.push( Transaction.rewardTransaction(this.wallet, Wallet.blockchainWallet()) ); console.log(validTransactions); console.log("//////"); const validMetadataS = this.transactionPool.validMetadataS(); // for (let i =0; i