public ChainedBlock SetTip(ChainBase otherChain) { if (otherChain == null) { throw new ArgumentNullException(nameof(otherChain)); } return(SetTip(otherChain.Tip)); }
public bool SameTip(ChainBase chain) { if (chain == null) { throw new ArgumentNullException(nameof(chain)); } return(Tip.HashBlock == chain.Tip.HashBlock); }
/// <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(nameof(chain)); } return(FindFork(chain.Tip.EnumerateToGenesis().Select(o => o.HashBlock))); }