persistence for the blockchain + everything through the chain instead of broadcasting

This commit is contained in:
Josip Milovac 2022-12-05 16:00:26 +11:00
parent 1cb1070d45
commit ea81105df6
5 changed files with 127 additions and 61 deletions

View file

@ -25,9 +25,8 @@ class Miner {
console.log(validTransactions);
// const validMetadataS = this.transactionPool.metadataS;
const block = this.blockchain.addBlock([validTransactions, validMetadataS]);
this.p2pServer.syncChains();
this.p2pServer.newBlock(block);
this.transactionPool.clear();
this.p2pServer.broadcastClearTransactions();
return block;
}