private void newBlock_Click(object sender, EventArgs e) { List <Transaction> transactions = blockchain.getPendingTransactions(); Block newBlock = new Block(blockchain.GetLastBlock(), transactions, publicKey.Text); blockchain.Blocks.Add(newBlock); richTextBox1.Text = blockchain.ToString(); }
private void newBlock_Click(object sender, EventArgs e) { // transactions to be included within the new block. List <Transaction> transactions = blockchain.getPendingTransactions(); // Create the new block w/ the transactions from the pool Block newBlock = new Block(blockchain.getPrevBlock(), transactions, publicKey.Text); // the block w/ transactions is added to the blockchain blockchain.Blocks.Add(newBlock); // the blockchain is printed to the UI. richTextBox1.Text = blockchain.ToString(); }
private void newBlock_Click(object sender, EventArgs e) { System.Diagnostics.Debug.WriteLine("hello " + comboBox1.SelectedIndex); //List<Transaction> transactions = blockchain.getPendingTransactions(); List <Transaction> transactions = blockchain.gettransactionPool(comboBox1.SelectedIndex, publicKey.Text); //System.Diagnostics.Debug.WriteLine(transactions[0].fee); Block newBlock = new Block(blockchain.GetLastBlock(), transactions, _Form1, publicKey.Text); blockchain.Blocks.Add(newBlock); richTextBox1.Text = blockchain.ToString(); }
private void newBlock_Click(object sender, EventArgs e) { int threads; if (!int.TryParse(numThreads.Text, out threads)) { threads = 1; } if (threads < 1) { threads = 1; // Use at least one thread } threads = Math.Min(threads, 6); // Don't use more threads than cores. List <Transaction> transactions = blockchain.GetPendingTransactions(preferenceCombo.Text, publicKey.Text); Block newBlock = new Block(blockchain.GetLastBlock(), transactions, publicKey.Text, threads, target: 0x000ffff000000000); blockchain.Blocks.Add(newBlock); richTextBox1.Text = blockchain.ToString(); }
// Print entire blockchain to UI private void ReadAll_Click(object sender, EventArgs e) { UpdateText(blockchain.ToString()); }
private void Button1_Click_1(object sender, EventArgs e) { outputToRichTextBox1(blockchain.ToString()); }