Unit Noso.Block

Description

This item has no description.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Packed Record BlockHeaderData  
Record TDBRecord  

Functions and Procedures

function AddRecordToDBFile(block, order, Source, target: Integer): Boolean;
procedure CreateDBFile();
function CreateOrderIDIndex(): Boolean;
function GetBlockFromOrder(OrderID: String): Integer;
function GetBlocksAsStream(out LMs: TMemoryStream; firstblock, CurrentLastblock: Integer): Int64;
function GetBlockTransfers(BlockNumber: Integer): TBlockOrders;
function GetDBLastBlock(): Integer;
function GetDBRecords(): Integer;
function GetMyLastUpdatedBlock(): Int64;
function GetOrderFromDB(OrderID: String; out OrderInfo: TOrderData): Boolean;
function InsertToIndex(LData: TDBRecord): Boolean;
function LoadBlockDataHeader(BlockNumber: Integer): BlockHeaderData;
function SaveStreamAsZipBlocks(const LStream: TMemoryStream): Boolean;
procedure SetBlockDirectory(NewFolder: String);
function UpdateBlockDatabase(): Boolean;

Types

IntArray = array of Integer;

Variables

BlockDirectory: String = 'NOSODATA' + DirectorySeparator + 'BLOCKS' + DirectorySeparator;
BlocksZipFile: String = 'blocks.zip';
DataBaseFilename: String = 'blocks_db.nos';
DBDirectory: String = 'DB' + DirectorySeparator;
DBFile: file of TDBRecord;
DBFileLock: TRTLCriticalSection;
DBIndexLock: TRTLCriticalSection;
OrderIDIndex: array of TindexRecord;

Description

Functions and Procedures

function AddRecordToDBFile(block, order, Source, target: Integer): Boolean;

Add a new record to the File and also to the index

procedure CreateDBFile();

Creates an empty DB file

function CreateOrderIDIndex(): Boolean;

Creates the INDEX from the file

function GetBlockFromOrder(OrderID: String): Integer;

Returns the block number where the order is found, or -1 if none

function GetBlocksAsStream(out LMs: TMemoryStream; firstblock, CurrentLastblock: Integer): Int64;

Creates the zip block file

function GetBlockTransfers(BlockNumber: Integer): TBlockOrders;

Return the array containing orders in the specified block

function GetDBLastBlock(): Integer;

Returns the last block on file

function GetDBRecords(): Integer;

Returns the records count on file

function GetMyLastUpdatedBlock(): Int64;

Returns the last downloaded block

function GetOrderFromDB(OrderID: String; out OrderInfo: TOrderData): Boolean;

Returns the order data from its orderID

function InsertToIndex(LData: TDBRecord): Boolean;

Insert a value on index

function LoadBlockDataHeader(BlockNumber: Integer): BlockHeaderData;

This item has no description.

function SaveStreamAsZipBlocks(const LStream: TMemoryStream): Boolean;

This item has no description.

procedure SetBlockDirectory(NewFolder: String);

This item has no description.

function UpdateBlockDatabase(): Boolean;

updates file and database to most recent block on disk

Types

IntArray = array of Integer;

This item has no description.

Variables

BlockDirectory: String = 'NOSODATA' + DirectorySeparator + 'BLOCKS' + DirectorySeparator;

This item has no description.

BlocksZipFile: String = 'blocks.zip';

This item has no description.

DataBaseFilename: String = 'blocks_db.nos';

This item has no description.

DBDirectory: String = 'DB' + DirectorySeparator;

This item has no description.

DBFile: file of TDBRecord;

This item has no description.

DBFileLock: TRTLCriticalSection;

This item has no description.

DBIndexLock: TRTLCriticalSection;

This item has no description.

OrderIDIndex: array of TindexRecord;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.