C# 클래스 BitSharper.Store.BoundedOverheadBlockStore

Stores the block chain to disk.
This implementation is designed to have constant memory usage, regardless of the size of the block chain being stored. It exploits operating system level buffering and the fact that get() requests are, in normal usage, localized in chain space.

Blocks are stored sequentially. Most blocks are fetched out of a small in-memory cache. The slowest part is traversing difficulty transition points, which requires seeking backwards over around 2000 blocks. On a Google Nexus S phone this takes a couple of seconds. On a MacBook Pro it takes around 50msec.

The store has much room for optimization. Expanding the size of the cache will likely allow us to traverse difficulty transitions without using too much memory and without hitting the disk at all, for the case of initial block chain download. Storing the hashes on disk would allow us to avoid deserialization and hashing which is expensive on Android.

상속: IBlockStore
파일 보기 프로젝트 열기: TangibleCryptography/BitSharper 1 사용 예제들

공개 메소드들

메소드 설명
BoundedOverheadBlockStore ( NetworkParameters @params, FileInfo file ) : System.Diagnostics
Dispose ( ) : void
Get ( Sha256Hash hash ) : StoredBlock
GetChainHead ( ) : StoredBlock
Put ( StoredBlock block ) : void
SetChainHead ( StoredBlock chainHead ) : void

비공개 메소드들

메소드 설명
CreateNewStore ( NetworkParameters @params, FileInfo file ) : void
GetRecord ( Sha256Hash hash ) : Record
Load ( FileInfo file ) : void

메소드 상세

BoundedOverheadBlockStore() 공개 메소드

public BoundedOverheadBlockStore ( NetworkParameters @params, FileInfo file ) : System.Diagnostics
@params NetworkParameters
file System.IO.FileInfo
리턴 System.Diagnostics

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Get() 공개 메소드

public Get ( Sha256Hash hash ) : StoredBlock
hash Sha256Hash
리턴 StoredBlock

GetChainHead() 공개 메소드

public GetChainHead ( ) : StoredBlock
리턴 StoredBlock

Put() 공개 메소드

public Put ( StoredBlock block ) : void
block StoredBlock
리턴 void

SetChainHead() 공개 메소드

public SetChainHead ( StoredBlock chainHead ) : void
chainHead StoredBlock
리턴 void