Exemple #1
0
        public void ComputeChecksum(uint256 hashBlock)
        {
            MemoryStream ms = new MemoryStream();

            hashBlock.AsBitcoinSerializable().ReadWrite(ms, true);
            this.ReadWrite(ms, true);
            CalculatedChecksum = Hashes.Hash256(ms.ToArray());
        }
Exemple #2
0
        public void spanUintSerializationTests()
        {
            var v = new uint256(RandomUtils.GetBytes(32));

            Assert.Equal(v, new uint256(v.ToBytes()));
            AssertEx.CollectionEquals(v.ToBytes(), v.AsBitcoinSerializable().ToBytes());
            uint256.MutableUint256 mutable = new uint256.MutableUint256();
            mutable.ReadWrite(v.ToBytes(), Network.Main);
            Assert.Equal(v, mutable.Value);
        }
Exemple #3
0
		public void ComputeChecksum(uint256 hashBlock)
		{
			MemoryStream ms = new MemoryStream();
			hashBlock.AsBitcoinSerializable().ReadWrite(ms, true);
			this.ReadWrite(ms, true);
			CalculatedChecksum = Hashes.Hash256(ms.ToArray());
		}
Exemple #4
0
		public void SetBestBlock(uint256 blockId)
		{
			Index.PutAsync("B", blockId.AsBitcoinSerializable());
		}
Exemple #5
0
 public void SetBestBlock(uint256 blockId)
 {
     Index.PutAsync("B", blockId.AsBitcoinSerializable());
 }
Exemple #6
0
 public void SetBestBlock(uint256 blockId)
 {
     this.NoSqlRepository.PutAsync("B", blockId.AsBitcoinSerializable());
 }