|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.bitcoin.core.DiskBlockStore
public class DiskBlockStore
Stores the block chain to disk but still holds it in memory. This is intended for desktop apps and tests. Constrained environments like mobile phones probably won't want to or be able to store all the block headers in RAM.
Constructor Summary | |
---|---|
DiskBlockStore(NetworkParameters params,
File file)
|
Method Summary | |
---|---|
StoredBlock |
get(byte[] hash)
Returns the StoredBlock given a hash. |
StoredBlock |
getChainHead()
Returns the StoredBlock that represents the top of the chain of greatest total work. |
void |
put(StoredBlock block)
Saves the given block header+extra data. |
void |
setChainHead(StoredBlock chainHead)
Sets the StoredBlock that represents the top of the chain of greatest total work. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DiskBlockStore(NetworkParameters params, File file) throws BlockStoreException
BlockStoreException
Method Detail |
---|
public void put(StoredBlock block) throws BlockStoreException
BlockStore
put
in interface BlockStore
BlockStoreException
public StoredBlock get(byte[] hash) throws BlockStoreException
BlockStore
get
in interface BlockStore
BlockStoreException
public StoredBlock getChainHead() throws BlockStoreException
BlockStore
StoredBlock
that represents the top of the chain of greatest total work.
getChainHead
in interface BlockStore
BlockStoreException
public void setChainHead(StoredBlock chainHead) throws BlockStoreException
BlockStore
StoredBlock
that represents the top of the chain of greatest total work.
setChainHead
in interface BlockStore
BlockStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |