public static byte[] ToBytes(this ChainIndexer chainIndexer)
 {
     using (var ms = new MemoryStream())
     {
         chainIndexer.WriteTo(ms);
         return(ms.ToArray());
     }
 }
 public static void WriteTo(this ChainIndexer chainIndexer, Stream stream)
 {
     chainIndexer.WriteTo(new BitcoinStream(stream, true));
 }