Exemplo n.º 1
0
 private void CheckCommits()
 {
     if (context.CommitPayloads.Count(p => p != null) >= context.M() && context.TransactionHashes.All(p => context.Transactions.ContainsKey(p)))
     {
         Block block = context.CreateBlock();
         Log($"relay block: {block.Hash}");
         localNode.Tell(new LocalNode.Relay {
             Inventory = block
         });
     }
 }
Exemplo n.º 2
0
 private void CheckCommits()
 {
     if (context.CommitPayloads.Count(p => p?.ConsensusMessage.ViewNumber == context.ViewNumber) >= context.M() && context.TransactionHashes.All(p => context.Transactions.ContainsKey(p)))
     {
         Block block = context.CreateBlock();
         Log($"relay block: height={block.Index} hash={block.Hash} tx={block.Transactions.Length}");
         localNode.Tell(new LocalNode.Relay {
             Inventory = block
         });
     }
 }