Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
and block chain management. |
org.bitcoinj.core.listeners | |
org.bitcoinj.jni | |
org.bitcoinj.params |
Network parameters encapsulate some of the differences between different Bitcoin networks such as the main
network, the testnet, regtest mode, unit testing params and so on.
|
org.bitcoinj.store |
Block stores persist blockchain data downloaded from remote peers.
|
org.bitcoinj.utils |
Formatting monetary amounts, representing exchange rates, a program for loading Bitcoin Core saved block files,
a class to control how bitcoinj uses threads and misc other utility classes that don't fit anywhere else.
|
org.bitcoinj.wallet |
Classes that support the
Wallet , which knows how to find and save transactions relevant to
a set of keys or scripts, calculate balances, and spend money: the wallet has many features and can be extended
in various ways, please refer to the website for documentation on how to use it. |
Modifier and Type | Field and Description |
---|---|
protected StoredBlock |
AbstractBlockChain.chainHead
Tracks the top of the best known chain.
|
Modifier and Type | Field and Description |
---|---|
protected TreeMap<Long,StoredBlock> |
CheckpointManager.checkpoints |
Modifier and Type | Method and Description |
---|---|
protected StoredBlock |
BlockChain.addToBlockStore(StoredBlock storedPrev,
Block blockHeader) |
protected abstract StoredBlock |
AbstractBlockChain.addToBlockStore(StoredBlock storedPrev,
Block block)
Adds/updates the given
Block with the block store. |
protected StoredBlock |
FullPrunedBlockChain.addToBlockStore(StoredBlock storedPrev,
Block block) |
protected StoredBlock |
BlockChain.addToBlockStore(StoredBlock storedPrev,
Block blockHeader,
TransactionOutputChanges txOutChanges) |
protected abstract StoredBlock |
AbstractBlockChain.addToBlockStore(StoredBlock storedPrev,
Block header,
TransactionOutputChanges txOutputChanges)
Adds/updates the given
StoredBlock with the block store. |
protected StoredBlock |
FullPrunedBlockChain.addToBlockStore(StoredBlock storedPrev,
Block header,
TransactionOutputChanges txOutChanges) |
StoredBlock |
StoredBlock.build(Block block)
Creates a new StoredBlock, calculating the additional fields by adding to the values in this block.
|
static StoredBlock |
StoredBlock.deserializeCompact(NetworkParameters params,
ByteBuffer buffer)
De-serializes the stored block from a custom packed format.
|
StoredBlock |
AbstractBlockChain.getChainHead()
Returns the block at the head of the current best chain.
|
StoredBlock |
CheckpointManager.getCheckpointBefore(long time)
Returns a
StoredBlock representing the last checkpoint before the given time, for example, normally
you would want to know the checkpoint before the earliest wallet birthday. |
StoredBlock |
StoredBlock.getPrev(BlockStore store)
Given a block store, looks up the previous block in this chain.
|
protected StoredBlock |
BlockChain.getStoredBlockInCurrentScope(Sha256Hash hash) |
protected abstract StoredBlock |
AbstractBlockChain.getStoredBlockInCurrentScope(Sha256Hash hash)
For a standard BlockChain, this should return blockStore.get(hash),
for a FullPrunedBlockChain blockStore.getOnceUndoableStoredBlock(hash)
|
protected StoredBlock |
FullPrunedBlockChain.getStoredBlockInCurrentScope(Sha256Hash hash) |
Modifier and Type | Method and Description |
---|---|
ListenableFuture<StoredBlock> |
AbstractBlockChain.getHeightFuture(int height)
Returns a future that completes when the block chain has reached the given height.
|
Modifier and Type | Method and Description |
---|---|
protected StoredBlock |
BlockChain.addToBlockStore(StoredBlock storedPrev,
Block blockHeader) |
protected abstract StoredBlock |
AbstractBlockChain.addToBlockStore(StoredBlock storedPrev,
Block block)
Adds/updates the given
Block with the block store. |
protected StoredBlock |
FullPrunedBlockChain.addToBlockStore(StoredBlock storedPrev,
Block block) |
protected StoredBlock |
BlockChain.addToBlockStore(StoredBlock storedPrev,
Block blockHeader,
TransactionOutputChanges txOutChanges) |
protected abstract StoredBlock |
AbstractBlockChain.addToBlockStore(StoredBlock storedPrev,
Block header,
TransactionOutputChanges txOutputChanges)
Adds/updates the given
StoredBlock with the block store. |
protected StoredBlock |
FullPrunedBlockChain.addToBlockStore(StoredBlock storedPrev,
Block header,
TransactionOutputChanges txOutChanges) |
abstract void |
NetworkParameters.checkDifficultyTransitions(StoredBlock storedPrev,
Block next,
BlockStore blockStore)
Throws an exception if the block's difficulty is not correct.
|
protected TransactionOutputChanges |
BlockChain.connectTransactions(StoredBlock newBlock) |
protected abstract TransactionOutputChanges |
AbstractBlockChain.connectTransactions(StoredBlock newBlock)
Load newBlock from BlockStore and connect its transactions, returning changes to the set of unspent transactions.
|
protected TransactionOutputChanges |
FullPrunedBlockChain.connectTransactions(StoredBlock newBlock) |
protected void |
BlockChain.disconnectTransactions(StoredBlock block) |
protected abstract void |
AbstractBlockChain.disconnectTransactions(StoredBlock block)
Disconnect each transaction in the block (after reading it from the block store)
Only called if(shouldVerifyTransactions())
|
protected void |
FullPrunedBlockChain.disconnectTransactions(StoredBlock oldBlock)
This is broken for blocks that do not pass BIP30, so all BIP30-failing blocks which are allowed to fail BIP30
must be checkpointed.
|
protected void |
BlockChain.doSetChainHead(StoredBlock chainHead) |
protected abstract void |
AbstractBlockChain.doSetChainHead(StoredBlock chainHead)
Called before setting chain head in memory.
|
protected void |
FullPrunedBlockChain.doSetChainHead(StoredBlock chainHead) |
boolean |
StoredBlock.moreWorkThan(StoredBlock other)
Returns true if this objects chainWork is higher than the others.
|
void |
Transaction.setBlockAppearance(StoredBlock block,
boolean bestChain,
int relativityOffset)
Puts the given block in the internal set of blocks in which this transaction appears.
|
protected void |
AbstractBlockChain.setChainHead(StoredBlock chainHead) |
Modifier and Type | Method and Description |
---|---|
void |
NewBestBlockListener.notifyNewBestBlock(StoredBlock block)
Called when a new block on the best chain is seen, after relevant
transactions are extracted and sent to us via either
TransactionReceivedInBlockListener#receiveFromBlock(org.bitcoinj.core.Transaction, org.bitcoinj.core.StoredBlock, org.bitcoinj.core.BlockChain.NewBlockType, int relativityOffset)
or TransactionReceivedInBlockListener#notifyTransactionIsInBlock(org.bitcoinj.core.Sha256Hash, org.bitcoinj.core.StoredBlock, org.bitcoinj.core.BlockChain.NewBlockType, int) . |
void |
AbstractBlockChainListener.notifyNewBestBlock(StoredBlock block)
Deprecated.
|
boolean |
TransactionReceivedInBlockListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new FilteredBlock that contains the given
transaction hash in its merkle tree. |
boolean |
AbstractBlockChainListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Deprecated.
|
void |
TransactionReceivedInBlockListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new block that contains a relevant transaction. |
void |
AbstractBlockChainListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Deprecated.
|
void |
AbstractBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Deprecated.
|
void |
ReorganizeListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Called by the
BlockChain when the best chain
(representing total work done) has changed. |
Modifier and Type | Method and Description |
---|---|
void |
AbstractBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Deprecated.
|
void |
AbstractBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Deprecated.
|
void |
ReorganizeListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Called by the
BlockChain when the best chain
(representing total work done) has changed. |
void |
ReorganizeListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Called by the
BlockChain when the best chain
(representing total work done) has changed. |
Modifier and Type | Method and Description |
---|---|
void |
NativeBlockChainListener.notifyNewBestBlock(StoredBlock block) |
boolean |
NativeBlockChainListener.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset) |
void |
NativeBlockChainListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset) |
void |
NativeBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks) |
Modifier and Type | Method and Description |
---|---|
void |
NativeBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks) |
void |
NativeBlockChainListener.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks) |
Modifier and Type | Method and Description |
---|---|
void |
AbstractBitcoinNetParams.checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore) |
void |
TestNet3Params.checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore) |
protected boolean |
AbstractBitcoinNetParams.isDifficultyTransitionPoint(StoredBlock storedPrev)
Checks if we are at a difficulty transition point.
|
Modifier and Type | Field and Description |
---|---|
StoredBlock |
MemoryFullPrunedBlockStore.StoredBlockAndWasUndoableFlag.block |
protected StoredBlock |
LevelDBFullPrunedBlockStore.chainHeadBlock |
protected StoredBlock |
DatabaseFullPrunedBlockStore.chainHeadBlock |
protected StoredBlock |
SPVBlockStore.lastChainHead |
protected StoredBlock |
LevelDBFullPrunedBlockStore.verifiedChainHeadBlock |
protected StoredBlock |
DatabaseFullPrunedBlockStore.verifiedChainHeadBlock |
Modifier and Type | Field and Description |
---|---|
protected LinkedHashMap<Sha256Hash,StoredBlock> |
SPVBlockStore.blockCache |
Modifier and Type | Method and Description |
---|---|
StoredBlock |
SPVBlockStore.get(Sha256Hash hash) |
StoredBlock |
MemoryFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
LevelDBFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
LevelDBBlockStore.get(Sha256Hash hash) |
StoredBlock |
BlockStore.get(Sha256Hash hash)
Returns the StoredBlock given a hash.
|
StoredBlock |
DatabaseFullPrunedBlockStore.get(Sha256Hash hash) |
StoredBlock |
MemoryBlockStore.get(Sha256Hash hash) |
StoredBlock |
LevelDBFullPrunedBlockStore.get(Sha256Hash hash,
boolean wasUndoableOnly) |
StoredBlock |
DatabaseFullPrunedBlockStore.get(Sha256Hash hash,
boolean wasUndoableOnly) |
StoredBlock |
SPVBlockStore.getChainHead() |
StoredBlock |
MemoryFullPrunedBlockStore.getChainHead() |
StoredBlock |
LevelDBFullPrunedBlockStore.getChainHead() |
StoredBlock |
LevelDBBlockStore.getChainHead() |
StoredBlock |
BlockStore.getChainHead()
Returns the
StoredBlock that represents the top of the chain of greatest total work. |
StoredBlock |
DatabaseFullPrunedBlockStore.getChainHead() |
StoredBlock |
MemoryBlockStore.getChainHead() |
StoredBlock |
MemoryFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
LevelDBFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
DatabaseFullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash) |
StoredBlock |
FullPrunedBlockStore.getOnceUndoableStoredBlock(Sha256Hash hash)
Returns the StoredBlock that was added as a StoredUndoableBlock given a hash.
|
StoredBlock |
MemoryFullPrunedBlockStore.getVerifiedChainHead() |
StoredBlock |
LevelDBFullPrunedBlockStore.getVerifiedChainHead() |
StoredBlock |
DatabaseFullPrunedBlockStore.getVerifiedChainHead() |
StoredBlock |
FullPrunedBlockStore.getVerifiedChainHead()
Returns the
StoredBlock that represents the top of the chain of greatest total work that has
been fully verified and the point in the chain at which the unspent transaction output set in this
store represents. |
Modifier and Type | Method and Description |
---|---|
void |
SPVBlockStore.put(StoredBlock block) |
void |
MemoryFullPrunedBlockStore.put(StoredBlock block) |
void |
LevelDBFullPrunedBlockStore.put(StoredBlock block) |
void |
LevelDBBlockStore.put(StoredBlock block) |
void |
BlockStore.put(StoredBlock block)
Saves the given block header+extra data.
|
void |
DatabaseFullPrunedBlockStore.put(StoredBlock storedBlock) |
void |
MemoryBlockStore.put(StoredBlock block) |
void |
MemoryFullPrunedBlockStore.put(StoredBlock storedBlock,
StoredUndoableBlock undoableBlock) |
void |
PostgresFullPrunedBlockStore.put(StoredBlock storedBlock,
StoredUndoableBlock undoableBlock) |
void |
LevelDBFullPrunedBlockStore.put(StoredBlock storedBlock,
StoredUndoableBlock undoableBlock) |
void |
DatabaseFullPrunedBlockStore.put(StoredBlock storedBlock,
StoredUndoableBlock undoableBlock) |
void |
FullPrunedBlockStore.put(StoredBlock storedBlock,
StoredUndoableBlock undoableBlock)
Saves the given
StoredUndoableBlock and StoredBlock . |
protected void |
LevelDBFullPrunedBlockStore.putUpdateStoredBlock(StoredBlock storedBlock,
boolean wasUndoable) |
protected void |
DatabaseFullPrunedBlockStore.putUpdateStoredBlock(StoredBlock storedBlock,
boolean wasUndoable) |
void |
SPVBlockStore.setChainHead(StoredBlock chainHead) |
void |
MemoryFullPrunedBlockStore.setChainHead(StoredBlock chainHead) |
void |
LevelDBFullPrunedBlockStore.setChainHead(StoredBlock chainHead) |
void |
LevelDBBlockStore.setChainHead(StoredBlock chainHead) |
void |
BlockStore.setChainHead(StoredBlock chainHead)
Sets the
StoredBlock that represents the top of the chain of greatest total work. |
void |
DatabaseFullPrunedBlockStore.setChainHead(StoredBlock chainHead) |
void |
MemoryBlockStore.setChainHead(StoredBlock chainHead) |
void |
MemoryFullPrunedBlockStore.setVerifiedChainHead(StoredBlock chainHead) |
void |
LevelDBFullPrunedBlockStore.setVerifiedChainHead(StoredBlock chainHead) |
void |
DatabaseFullPrunedBlockStore.setVerifiedChainHead(StoredBlock chainHead) |
void |
FullPrunedBlockStore.setVerifiedChainHead(StoredBlock chainHead)
Sets the
StoredBlock that represents the top of the chain of greatest total work that has been
fully verified. |
Constructor and Description |
---|
StoredBlockAndWasUndoableFlag(StoredBlock block,
boolean wasUndoable) |
Modifier and Type | Method and Description |
---|---|
void |
VersionTally.initialize(BlockStore blockStore,
StoredBlock chainHead)
Initialize the version tally from the block store.
|
Modifier and Type | Method and Description |
---|---|
void |
Wallet.notifyNewBestBlock(StoredBlock block)
Called by the
BlockChain when a new block on the best chain is seen, AFTER relevant wallet
transactions are extracted and sent to us UNLESS the new block caused a re-org, in which case this will
not be called (the Wallet.reorganize(StoredBlock, java.util.List, java.util.List) method will
call this one in that case). |
boolean |
Wallet.notifyTransactionIsInBlock(Sha256Hash txHash,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new filtered block that contains a transactions previously
received by a call to Wallet.receivePending(org.bitcoinj.core.Transaction, java.util.List<org.bitcoinj.core.Transaction>, boolean) . |
void |
Wallet.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new block that sends coins to one of our addresses or
spends coins from one of our addresses (note that a single transaction can do both). |
void |
Wallet.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Don't call this directly.
|
Modifier and Type | Method and Description |
---|---|
void |
Wallet.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Don't call this directly.
|
void |
Wallet.reorganize(StoredBlock splitPoint,
List<StoredBlock> oldBlocks,
List<StoredBlock> newBlocks)
Don't call this directly.
|
Copyright © 2016. All rights reserved.