Show / Hide Table of Contents

    Interface ILedger

    This represents the ledger used to represent and store the state of the Catalyst network. It acts a unique source of truth which can be queried to retrieve account balances and which can only be updated by Delta / Ledger State Update objects.

    Namespace: Catalyst.Core.Modules.Ledger
    Assembly: Catalyst.Core.Modules.Ledger.dll
    Syntax
    public interface ILedger

    Properties

    | Improve this Doc View Source

    IsSynchonising

    A boolean indicating whether a synchronisation of the ledger is in currently in process.

    Declaration
    bool IsSynchonising { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LatestKnownDelta

    The latest hash that was process

    Declaration
    MultiHash LatestKnownDelta { get; }
    Property Value
    Type Description
    MultiHash

    Methods

    | Improve this Doc View Source

    SaveAccountState(Account)

    Saves the new state of a give IAccount on the ledger.

    Declaration
    bool SaveAccountState(Account account)
    Parameters
    Type Name Description
    Account account

    The new state of the account, to be inserted or updated in the ledger.

    Returns
    Type Description
    System.Boolean

    true if the update succeeded, false otherwise.

    Remarks

    This might need to become private if we consider that accounts should only be updated through deltas as they emerge from the consensus mechanism.

    | Improve this Doc View Source

    Update(MultiHash)

    Digests the information contained in a Delta object and uses it to update the various accounts involved in the transactions it contains. An update will trigger a potentially long running synchronisation if the delta received is not immediately following the current LatestKnownDelta.

    Declaration
    void Update(MultiHash deltaHash)
    Parameters
    Type Name Description
    MultiHash deltaHash

    The address of the delta used to update the ledger on the Dfs.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Catalyst Network