Beispiel #1
0
        private RegistryConfidenceBlock GetConfidence(RegistryShortBlock transactionsShortBlock)
        {
            _registryMemPool.EnqueueTransactionsShortBlock(transactionsShortBlock);

            byte[] proof = _registryMemPool.GetConfidenceMask(transactionsShortBlock, out byte[] bitMask);

            SynchronizationDescriptor synchronizationDescriptor           = _synchronizationContext.LastBlockDescriptor;
            RegistryConfidenceBlock   transactionsRegistryConfidenceBlock = new RegistryConfidenceBlock()
            {
                SyncBlockHeight     = transactionsShortBlock.SyncBlockHeight,
                Nonce               = transactionsShortBlock.Nonce,
                PowHash             = transactionsShortBlock.PowHash,
                BlockHeight         = transactionsShortBlock.BlockHeight,
                ReferencedBlockHash = _defaulHashCalculation.CalculateHash(transactionsShortBlock.RawData),
                BitMask             = bitMask,
                ConfidenceProof     = proof
            };

            _logger.Debug($"BitMask of Confidence for RegistryShortBlock at round {transactionsShortBlock.BlockHeight} with {transactionsShortBlock.TransactionHeaderHashes.Count} hashes is {transactionsRegistryConfidenceBlock.BitMask.ToHexString()}");

            return(transactionsRegistryConfidenceBlock);
        }