Unit Noso.Headers
Description
Standalone unit to control headers file.
Uses
- Classes
- Noso.Crypto
- Noso.Debug
- Noso.General
- SysUtils
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Packed Record TBlockSummary |
Record to hold summary data for a block |
Functions and Procedures
function AddRecordToHeaders(const BlockNumber: Int64; const BlockHash, SumHash: String): Boolean; |
function CreateHeadersFile(): Boolean; |
function GetHeadersAsMemoryStream(var Stream: TMemoryStream): Int64; |
function GetHeadersAsStringFromBlock(FromBlock: Integer): String; |
function GetHeadersCount(): Integer; |
function GetLastHeaderBlock(): Integer; |
function GetSummaryFileHash(): String; |
function RemoveLastHeaderRecord(): Boolean; |
function SaveMemoryStreamAsHeaders(var Stream: TMemoryStream): Boolean; |
function SetHeadersFileName(const Filename: String): Boolean; |
procedure SetSummaryFileHash(); |
Variables
CurrentSummaryFileHash: String = ''; |
HeadersFileCriticalSection: TRTLCriticalSection; |
SummaryFile: file of TBlockSummary; |
SummaryFilename: String = 'blchhead.nos'; |
Description
Functions and Procedures
function AddRecordToHeaders(const BlockNumber: Int64; const BlockHash, SumHash: String): Boolean; |
|
Adds a new record to the headers file.
Parameters
Returns
|
function CreateHeadersFile(): Boolean; |
|
Creates a new headers file or overwrites an existing one.
Returns
|
function GetHeadersAsMemoryStream(var Stream: TMemoryStream): Int64; |
|
Loads the headers file into a memory stream.
Parameters
ReturnsThe size of the loaded headers in bytes. |
function GetHeadersAsStringFromBlock(FromBlock: Integer): String; |
|
Retrieves headers data as a string starting from a specified block.
Parameters
ReturnsA string representing the headers data from the specified block. |
function GetHeadersCount(): Integer; |
|
Retrieves the number of records in the headers file.
ReturnsThe number of records in the headers file. |
function GetLastHeaderBlock(): Integer; |
|
Retrieves the block number of the last record in the headers file.
ReturnsThe block number of the last record. |
function GetSummaryFileHash(): String; |
|
Retrieves the current hash of the summary file.
ReturnsThe hash of the summary file. |
function RemoveLastHeaderRecord(): Boolean; |
|
Removes the last record from the headers file.
Returns
|
function SaveMemoryStreamAsHeaders(var Stream: TMemoryStream): Boolean; |
|
Saves the contents of a memory stream as the headers file.
Parameters
Returns
|
function SetHeadersFileName(const Filename: String): Boolean; |
|
Sets the path and name of the headers file.
Parameters
Returns
|
procedure SetSummaryFileHash(); |
|
Sets the hash of the summary file to reflect the current file state. |
Variables
CurrentSummaryFileHash: String = ''; |
|
The current hash of the summary file. |
HeadersFileCriticalSection: TRTLCriticalSection; |
|
Critical section for synchronizing access to the headers file. |
SummaryFile: file of TBlockSummary; |
|
The file handle for the summary file. |
SummaryFilename: String = 'blchhead.nos'; |
|
The path and name of the summary file. |
Generated by PasDoc 0.16.0-snapshot.