//-----Functions public void CreateGenesisBlock() { BlockHeader genesisBlockHeader = new BlockHeader(0, BlockchainFunctions.Timestamp(), "0000000000000000000000000000000000000000000000000000000000000000"); Block genesisBlock = new Block(genesisBlockHeader, pendingTransactions.ToArray()); genesisBlock.MineBlock(difficulty); chain.Add(genesisBlock); }
public void MineSelectedTransactions(string minerAddress) { BlockHeader newBlockHeader = new BlockHeader(chain.ToArray().Length, BlockchainFunctions.Timestamp(), GetLatestBlock().hash); Block newBlock = new Block(newBlockHeader, SelectPendingTransactions(blockSize)); newBlock.MineBlock(difficulty); chain.Add(newBlock); }