C# Class BitMaker.Miner.Pool

Encapsulates access to a mining pool.
Inheritance: IDisposable
Show file Open project: wasabii/BitMaker

Public Methods

Method Description
Dispose ( ) : void

Disposes of the pool and releases all resources associated with it.

GetWorkRpc ( IMiner miner, string comment ) : BitMaker.Miner.Work

Invokes the 'getwork' JSON method and parses the result into a new T:Work instance.

SubmitWorkRpc ( IMiner miner, BitMaker.Miner.Work work, string comment ) : bool

Invokes the 'getwork' JSON method, submitting the proposed work. Returns true if the service accepts the proposed work.

Private Methods

Method Description
GetWorkLp ( IMiner miner, string comment ) : BitMaker.Miner.Work

Initiates a long-poll request for work.

Open ( Uri url, string method, IMiner miner, string comment ) : HttpWebRequest

Opens a web request.

OpenLp ( IMiner miner, string comment ) : HttpWebRequest

Creates a HttpWebRequest for long-polling.

OpenRpc ( IMiner miner, string comment ) : HttpWebRequest

Creates a HttpWebRequest for JSON-RPC.

ParseGetWork ( WebResponse webResponse ) : BitMaker.Miner.Work

Parses a WebResponse containing the results of a 'getwork' request.

Pool ( Uri url ) : System

Initializes a new instance.

RefreshThreadMain ( ) : void

Entry point for thread responsible for detecting changes in the current block number.

Method Details

Dispose() public method

Disposes of the pool and releases all resources associated with it.
public Dispose ( ) : void
return void

GetWorkRpc() public method

Invokes the 'getwork' JSON method and parses the result into a new T:Work instance.
public GetWorkRpc ( IMiner miner, string comment ) : BitMaker.Miner.Work
miner IMiner
comment string
return BitMaker.Miner.Work

SubmitWorkRpc() public method

Invokes the 'getwork' JSON method, submitting the proposed work. Returns true if the service accepts the proposed work.
public SubmitWorkRpc ( IMiner miner, BitMaker.Miner.Work work, string comment ) : bool
miner IMiner
work BitMaker.Miner.Work
comment string
return bool