Home Reference Source
public class | source

ServerPoolData

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

miners: *[]

public
public

pools: *[]

Private Members
private

_db: *

Method Summary

Public Methods
public

async addPool(minerAddress: *, minerReward: *): *

Insert a new miner if not exists.

public

getPool(poolAddress: *, returnPos: boolean): *

public

Load miners from database

public

async removePool(minerAddress: *): *

Remove a miner if exists.

public

Save miners to database

Private Methods
private

_deserializeServerPools(buffer: *, offset: number): boolean

private

Public Constructors

public constructor() source

Public Members

public miners: *[] source

public poolManagement: * source

public pools: *[] source

Private Members

private _db: * source

Public Methods

public async addPool(minerAddress: *, minerReward: *): * source

Insert a new miner if not exists. Synchronizes with DB.

Params:

NameTypeAttributeDescription
minerAddress *
minerReward *

Return:

*

true/false

public getPool(poolAddress: *, returnPos: boolean): * source

Params:

NameTypeAttributeDescription
poolAddress *
returnPos boolean
  • optional
  • default: false

Return:

*

public async loadServerPoolsList(): boolean source

Load miners from database

Return:

boolean

true is success, otherwise false

public async removePool(minerAddress: *): * source

Remove a miner if exists. Synchronizes with DB.

Params:

NameTypeAttributeDescription
minerAddress *

Return:

*

true/false

public async saveServerPoolsList(): boolean source

Save miners to database

Return:

boolean

true is success, otherwise false

Private Methods

private _deserializeServerPools(buffer: *, offset: number): boolean source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

boolean

private _serializeServerPools(): * source

Return:

*