|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.bitcoin.core.MemoryBlockStore
public class MemoryBlockStore
Keeps StoredBlock
s in memory. Used primarily for unit testing.
Constructor Summary | |
---|---|
MemoryBlockStore(NetworkParameters params)
|
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 MemoryBlockStore(NetworkParameters params)
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()
BlockStore
StoredBlock
that represents the top of the chain of greatest total work.
getChainHead
in interface BlockStore
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 |