public ConcurrentChain Clone() { ConcurrentChain chain = new ConcurrentChain(); chain._Tip = _Tip; using(@lock.LockRead()) { foreach(var kv in _BlocksById) { chain._BlocksById.Add(kv.Key, kv.Value); } foreach(var kv in _BlocksByHeight) { chain._BlocksByHeight.Add(kv.Key, kv.Value); } } return chain; }
public ConcurrentChain GetMainChain() { ConcurrentChain chain = new ConcurrentChain(); SynchronizeChain(chain); return chain; }
public static ChainedBlock GetBlock(this ConcurrentChain me, Height height) => me.GetBlock(height.Value);