Exemplo n.º 1
0
        public void start(string block_header_storage_path, ulong starting_block_height, byte[] starting_block_checksum)
        {
            if (running)
            {
                return;
            }

            BlockHeaderStorage.init(block_header_storage_path);

            BlockHeader last_block_header = BlockHeaderStorage.getLastBlockHeader();

            if (last_block_header != null && last_block_header.blockNum > starting_block_height)
            {
                lastBlockHeader = last_block_header;
            }
            else
            {
                BlockHeaderStorage.deleteCache();
                lastBlockHeader = new BlockHeader()
                {
                    blockNum = starting_block_height, blockChecksum = starting_block_checksum
                };
            }

            running = true;
            // Start the thread
            tiv_thread      = new Thread(onUpdate);
            tiv_thread.Name = "TIV_Update_Thread";
            tiv_thread.Start();
        }
Exemplo n.º 2
0
        public TransactionInclusion(string block_header_storage_path = "", ulong starting_block_height = 1, byte[] starting_block_checksum = null)
        {
            BlockHeaderStorage.init(block_header_storage_path);

            BlockHeader last_block_header = BlockHeaderStorage.getLastBlockHeader();

            if (last_block_header != null && last_block_header.blockNum > starting_block_height)
            {
                lastBlockHeader = last_block_header;
            }
            else
            {
                BlockHeaderStorage.deleteCache();
                lastBlockHeader = new BlockHeader()
                {
                    blockNum = starting_block_height, blockChecksum = starting_block_checksum
                };
            }
        }