Ejemplo n.º 1
0
 public ChainedBlock SetTip(ChainBase otherChain)
 {
     if (otherChain == null)
     {
         throw new ArgumentNullException("otherChain");
     }
     return(SetTip(otherChain.Tip));
 }
Ejemplo n.º 2
0
 public bool SameTip(ChainBase chain)
 {
     if (chain == null)
     {
         throw new ArgumentNullException("chain");
     }
     return(Tip.HashBlock == chain.Tip.HashBlock);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns the first common block between two chains
 /// </summary>
 /// <param name="chain">The other chain</param>
 /// <returns>First common block or null</returns>
 public ChainedBlock FindFork(ChainBase chain)
 {
     if (chain == null)
     {
         throw new ArgumentNullException("chain");
     }
     return(FindFork(chain.Tip.EnumerateToGenesis().Select(o => o.HashBlock)));
 }