本文整理汇总了Java中org.bitcoinj.core.StoredUndoableBlock类的典型用法代码示例。如果您正苦于以下问题:Java StoredUndoableBlock类的具体用法?Java StoredUndoableBlock怎么用?Java StoredUndoableBlock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StoredUndoableBlock类属于org.bitcoinj.core包,在下文中一共展示了StoredUndoableBlock类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createNewStore
import org.bitcoinj.core.StoredUndoableBlock; //导入依赖的package包/类
private void createNewStore(NetworkParameters params) throws BlockStoreException {
try {
// Set up the genesis block. When we start out fresh, it is by
// definition the top of the chain.
StoredBlock storedGenesisHeader = new StoredBlock(params.getGenesisBlock().cloneAsHeader(),
params.getGenesisBlock().getWork(), 0);
// The coinbase in the genesis block is not spendable. This is
// because of how the reference client inits
// its database - the genesis transaction isn't actually in the db
// so its spent flags can never be updated.
List<Transaction> genesisTransactions = Lists.newLinkedList();
StoredUndoableBlock storedGenesis = new StoredUndoableBlock(params.getGenesisBlock().getHash(),
genesisTransactions);
beginDatabaseBatchWrite();
put(storedGenesisHeader, storedGenesis);
setChainHead(storedGenesisHeader);
setVerifiedChainHead(storedGenesisHeader);
batchPut(getKey(KeyType.CREATED), bytes("done"));
commitDatabaseBatchWrite();
} catch (VerificationException e) {
throw new RuntimeException(e); // Cannot happen.
}
}
开发者ID:guodroid,项目名称:okwallet,代码行数:24,代码来源:LevelDBFullPrunedBlockStore.java
示例2: put
import org.bitcoinj.core.StoredUndoableBlock; //导入依赖的package包/类
/**
* <p>Saves the given {@link StoredUndoableBlock} and {@link StoredBlock}. Calculates keys from the {@link StoredBlock}</p>
*
* <p>Though not required for proper function of a FullPrunedBlockStore, any user of a FullPrunedBlockStore should ensure
* that a StoredUndoableBlock for each block up to the fully verified chain head has been added to this block store using
* this function (not put(StoredBlock)), so that the ability to perform reorgs is maintained.</p>
*
* @throws BlockStoreException if there is a problem with the underlying storage layer, such as running out of disk space.
*/
void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException;
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:11,代码来源:FullPrunedBlockStore.java
示例3: getUndoBlock
import org.bitcoinj.core.StoredUndoableBlock; //导入依赖的package包/类
/**
* Returns a {@link StoredUndoableBlock} whose block.getHash() method will be equal to the parameter. If no such
* block is found, returns null. Note that this may return null more often than get(Sha256Hash hash) as not all
* {@link StoredBlock}s have a {@link StoredUndoableBlock} copy stored as well.
*/
StoredUndoableBlock getUndoBlock(Sha256Hash hash) throws BlockStoreException;
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:7,代码来源:FullPrunedBlockStore.java
注:本文中的org.bitcoinj.core.StoredUndoableBlock类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论