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.kits |
High level wrapper APIs around the bitcoinj building blocks.
|
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.
|
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.
|
static void |
CheckpointManager.checkpoint(NetworkParameters params,
InputStream checkpoints,
BlockStore store,
long time)
Convenience method that creates a CheckpointManager, loads the given data, gets the checkpoint for the given
time, then inserts it into the store and sets that to be the chain head.
|
protected abstract TransactionOutputChanges |
AbstractBlockChain.connectTransactions(int height,
Block block)
Connect each transaction in block.transactions, verifying them as we go and removing spent outputs
If an error is encountered in a transaction, no changes should be made to the underlying BlockStore.
|
protected TransactionOutputChanges |
FullPrunedBlockChain.connectTransactions(int height,
Block block) |
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 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) |
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) |
protected void |
BlockChain.notSettingChainHead() |
protected abstract void |
AbstractBlockChain.notSettingChainHead()
Called if we (possibly) previously called disconnectTransaction/connectTransactions,
but will not be calling preSetChainHead as a block failed verification.
|
protected void |
FullPrunedBlockChain.notSettingChainHead() |
protected void |
BlockChain.rollbackBlockStore(int height) |
protected abstract void |
AbstractBlockChain.rollbackBlockStore(int height)
Rollback the block store to a given height.
|
protected void |
FullPrunedBlockChain.rollbackBlockStore(int height) |
protected void |
AbstractBlockChain.setChainHead(StoredBlock chainHead) |
Constructor and Description |
---|
AbstractBlockChain(Context context,
List<? extends Wallet> wallets,
BlockStore blockStore)
Constructs a BlockChain connected to the given list of listeners (eg, wallets) and a store.
|
AbstractBlockChain(NetworkParameters params,
List<? extends Wallet> transactionReceivedListeners,
BlockStore blockStore)
|
BlockChain(Context context,
BlockStore blockStore)
Constructs a BlockChain that has no wallet at all.
|
BlockChain(Context params,
List<? extends Wallet> wallets,
BlockStore blockStore)
Constructs a BlockChain connected to the given list of listeners and a store.
|
BlockChain(Context context,
Wallet wallet,
BlockStore blockStore)
Constructs a BlockChain connected to the given wallet and store.
|
BlockChain(NetworkParameters params,
BlockStore blockStore)
|
BlockChain(NetworkParameters params,
List<? extends Wallet> wallets,
BlockStore blockStore)
|
BlockChain(NetworkParameters params,
Wallet wallet,
BlockStore blockStore)
|
FullPrunedBlockChain(Context context,
FullPrunedBlockStore blockStore)
Constructs a block chain connected to the given store.
|
FullPrunedBlockChain(Context context,
List<Wallet> listeners,
FullPrunedBlockStore blockStore)
Constructs a block chain connected to the given list of wallets and a store.
|
FullPrunedBlockChain(Context context,
Wallet wallet,
FullPrunedBlockStore blockStore)
Constructs a block chain connected to the given wallet and store.
|
FullPrunedBlockChain(NetworkParameters params,
FullPrunedBlockStore blockStore)
|
FullPrunedBlockChain(NetworkParameters params,
List<Wallet> listeners,
FullPrunedBlockStore blockStore)
|
FullPrunedBlockChain(NetworkParameters params,
Wallet wallet,
FullPrunedBlockStore blockStore)
Constructs a block chain connected to the given wallet and store.
|
Modifier and Type | Method and Description |
---|---|
protected BlockStore |
WalletAppKit.provideBlockStore(File file)
Override this to use a
BlockStore that isn't the default of SPVBlockStore . |
Modifier and Type | Method and Description |
---|---|
void |
AbstractBitcoinNetParams.checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore) |
void |
TestNet3Params.checkDifficultyTransitions(StoredBlock storedPrev,
Block nextBlock,
BlockStore blockStore) |
Modifier and Type | Class and Description |
---|---|
class |
ChainFileLockedException
Thrown by
SPVBlockStore when the process cannot gain exclusive access to the chain file. |
Modifier and Type | Method and Description |
---|---|
void |
MemoryFullPrunedBlockStore.abortDatabaseBatchWrite() |
void |
LevelDBFullPrunedBlockStore.abortDatabaseBatchWrite() |
void |
DatabaseFullPrunedBlockStore.abortDatabaseBatchWrite() |
void |
FullPrunedBlockStore.abortDatabaseBatchWrite() |
void |
MemoryFullPrunedBlockStore.addUnspentTransactionOutput(UTXO out) |
void |
LevelDBFullPrunedBlockStore.addUnspentTransactionOutput(UTXO out) |
void |
DatabaseFullPrunedBlockStore.addUnspentTransactionOutput(UTXO out) |
void |
FullPrunedBlockStore.addUnspentTransactionOutput(UTXO out)
Adds a
UTXO to the list of unspent TransactionOutputs |
void |
MemoryFullPrunedBlockStore.beginDatabaseBatchWrite() |
void |
LevelDBFullPrunedBlockStore.beginDatabaseBatchWrite() |
void |
DatabaseFullPrunedBlockStore.beginDatabaseBatchWrite() |
void |
FullPrunedBlockStore.beginDatabaseBatchWrite()
Begins/Commits/Aborts a database transaction.
|
BigInteger |
DatabaseFullPrunedBlockStore.calculateBalanceForAddress(Address address)
Calculate the balance for a coinbase, to-address, or p2sh address.
|
void |
SPVBlockStore.close() |
void |
LevelDBFullPrunedBlockStore.close() |
void |
LevelDBBlockStore.close() |
void |
BlockStore.close()
Closes the store.
|
void |
MemoryFullPrunedBlockStore.commitDatabaseBatchWrite() |
void |
LevelDBFullPrunedBlockStore.commitDatabaseBatchWrite() |
void |
DatabaseFullPrunedBlockStore.commitDatabaseBatchWrite() |
void |
FullPrunedBlockStore.commitDatabaseBatchWrite() |
void |
DatabaseFullPrunedBlockStore.deleteStore()
Deletes the store by deleting the tables within the database.
|
void |
DatabaseFullPrunedBlockStore.dumpSizes()
Dumps information about the size of actual data in the database to standard output
The only truly useless data counted is printed in the form "N in id indexes"
This does not take database indexes into account.
|
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.
|
UTXO |
MemoryFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
UTXO |
LevelDBFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
UTXO |
DatabaseFullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index) |
UTXO |
FullPrunedBlockStore.getTransactionOutput(Sha256Hash hash,
long index)
Gets a
UTXO with the given hash and index, or null if none is found |
StoredUndoableBlock |
MemoryFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
LevelDBFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
DatabaseFullPrunedBlockStore.getUndoBlock(Sha256Hash hash) |
StoredUndoableBlock |
FullPrunedBlockStore.getUndoBlock(Sha256Hash hash)
Returns a
StoredUndoableBlock whose block.getHash() method will be equal to the parameter. |
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. |
boolean |
MemoryFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
LevelDBFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
DatabaseFullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs) |
boolean |
FullPrunedBlockStore.hasUnspentOutputs(Sha256Hash hash,
int numOutputs)
True if this store has any unspent outputs from a transaction with a hash equal to the first parameter
|
protected void |
DatabaseFullPrunedBlockStore.maybeConnect()
If there isn't a connection on the
ThreadLocal then create and store it. |
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 . |
void |
MemoryFullPrunedBlockStore.removeUnspentTransactionOutput(UTXO out) |
void |
LevelDBFullPrunedBlockStore.removeUnspentTransactionOutput(UTXO out) |
void |
DatabaseFullPrunedBlockStore.removeUnspentTransactionOutput(UTXO out) |
void |
FullPrunedBlockStore.removeUnspentTransactionOutput(UTXO out)
Removes a
UTXO from the list of unspent TransactionOutputs
Note that the coinbase of the genesis block should NEVER be spendable and thus never in the list. |
void |
LevelDBBlockStore.reset()
Erases the contents of the database (but NOT the underlying files themselves) and then reinitialises with the genesis block.
|
void |
DatabaseFullPrunedBlockStore.resetStore()
Resets the store by deleting the contents of the tables and reinitialising them.
|
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 |
---|
DatabaseFullPrunedBlockStore(NetworkParameters params,
String connectionURL,
int fullStoreDepth,
String username,
String password,
String schemaName)
Create a new DatabaseFullPrunedBlockStore, using the full connection URL instead of a hostname and password,
and optionally allowing a schema to be specified.
|
H2FullPrunedBlockStore(NetworkParameters params,
String dbName,
int fullStoreDepth)
Creates a new H2FullPrunedBlockStore
|
H2FullPrunedBlockStore(NetworkParameters params,
String dbName,
int fullStoreDepth,
int cacheSize)
Creates a new H2FullPrunedBlockStore with the given cache size
|
H2FullPrunedBlockStore(NetworkParameters params,
String dbName,
String username,
String password,
int fullStoreDepth)
Creates a new H2FullPrunedBlockStore, with given credentials for H2 database
|
LevelDBBlockStore(Context context,
File directory)
Creates a LevelDB SPV block store using the JNI/C++ version of LevelDB.
|
LevelDBBlockStore(Context context,
File directory,
org.iq80.leveldb.DBFactory dbFactory)
Creates a LevelDB SPV block store using the given factory, which is useful if you want a pure Java version.
|
MySQLFullPrunedBlockStore(NetworkParameters params,
int fullStoreDepth,
String hostname,
String dbName,
String username,
String password)
Creates a new MySQLFullPrunedBlockStore.
|
PostgresFullPrunedBlockStore(NetworkParameters params,
int fullStoreDepth,
String hostname,
String dbName,
String username,
String password)
Creates a new PostgresFullPrunedBlockStore.
|
PostgresFullPrunedBlockStore(NetworkParameters params,
int fullStoreDepth,
String hostname,
String dbName,
String username,
String password,
String schemaName)
Create a new PostgresFullPrunedBlockStore, storing the tables in the schema specified.
|
SPVBlockStore(NetworkParameters params,
File file)
Creates and initializes an SPV block store.
|
Modifier and Type | Method and Description |
---|---|
void |
VersionTally.initialize(BlockStore blockStore,
StoredBlock chainHead)
Initialize the version tally from the block store.
|
Copyright © 2016. All rights reserved.