C# Class BitSharper.DownloadListener

Listen to chain download events and print useful informational messages.
Progress, StartDownload, DoneDownload maybe be overridden to change the way the user is notified.

Methods are called with the event listener object locked so your implementation does not have to be thread safe. @author [email protected] (Miron Cuperman a.k.a. devrandom)

Inheritance: AbstractPeerEventListener
Show file Open project: TangibleCryptography/BitSharper Class Usage Examples

Public Methods

Method Description
Await ( ) : void

Wait for the chain to be downloaded.

OnBlocksDownloaded ( Peer peer, Block block, int blocksLeft ) : void
OnChainDownloadStarted ( Peer peer, int blocksLeft ) : void

Protected Methods

Method Description
DoneDownload ( ) : void

Called when we are done downloading the block chain.

Progress ( double pct, System.DateTime date ) : void

Called when download progress is made.

StartDownload ( int blocks ) : void

Called when download is initiated.

Method Details

Await() public method

Wait for the chain to be downloaded.
public Await ( ) : void
return void

DoneDownload() protected method

Called when we are done downloading the block chain.
protected DoneDownload ( ) : void
return void

OnBlocksDownloaded() public method

public OnBlocksDownloaded ( Peer peer, Block block, int blocksLeft ) : void
peer Peer
block Block
blocksLeft int
return void

OnChainDownloadStarted() public method

public OnChainDownloadStarted ( Peer peer, int blocksLeft ) : void
peer Peer
blocksLeft int
return void

Progress() protected method

Called when download progress is made.
protected Progress ( double pct, System.DateTime date ) : void
pct double The percentage of chain downloaded, estimated.
date System.DateTime The date of the last block downloaded.
return void

StartDownload() protected method

Called when download is initiated.
protected StartDownload ( int blocks ) : void
blocks int The number of blocks to download, estimated.
return void