Last active
May 17, 2021 04:30
-
-
Save bluepnume/9b8ccba6dbd5e51fd5ec7c3a0bbedc8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mine = async () : Promise<void> => { | |
await loop(async () => { | |
const transactions = mempool.slice(0, BLOCK_SIZE_LIMIT); | |
const hashedBlock = await blockchain.createBlock(await keypair.publicKey, transactions); | |
if (hashedBlock) { | |
await network.broadcast('ADD_BLOCK', hashedBlock); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment