org.bitcoinj.wallet.Wallet.setKeyChainGroupLookaheadSize()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(76)

本文整理了Java中org.bitcoinj.wallet.Wallet.setKeyChainGroupLookaheadSize()方法的一些代码示例,展示了Wallet.setKeyChainGroupLookaheadSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wallet.setKeyChainGroupLookaheadSize()方法的具体详情如下:
包路径:org.bitcoinj.wallet.Wallet
类名称:Wallet
方法名:setKeyChainGroupLookaheadSize

Wallet.setKeyChainGroupLookaheadSize介绍

[英]See org.bitcoinj.wallet.DeterministicKeyChain#setLookaheadSize(int) for more info on this.
[中]见org。比特币。钱包DeterministicKeyChain#setLookaheadSize(int)了解更多信息。

代码示例

代码示例来源:origin: HashEngineering/dashj

private static void addKey() {
  // If we're being given precise details, we have to import the key.
  if (options.has("privkey") || options.has("pubkey")) {
    importKey();
  } else {
    if (options.has(lookaheadSize)) {
      Integer size = options.valueOf(lookaheadSize);
      log.info("Setting keychain lookahead size to {}", size);
      wallet.setKeyChainGroupLookaheadSize(size);
    }
    ECKey key;
    try {
      key = wallet.freshReceiveKey();
    } catch (DeterministicUpgradeRequiredException e) {
      try {
        KeyParameter aesKey = passwordToKey(false);
        wallet.upgradeToDeterministic(aesKey);
      } catch (DeterministicUpgradeRequiresPassword e2) {
        System.err.println("This wallet must be upgraded to be deterministic, but it's encrypted: please supply the password and try again.");
        return;
      }
      key = wallet.freshReceiveKey();
    }
    System.out.println(key.toAddress(params) + " " + key);
  }
}

代码示例来源:origin: greenaddress/GreenBits

wallet.setKeyChainGroupLookaheadSize(4);
wallet.setKeyChainGroupLookaheadThreshold(2);

代码示例来源:origin: greenaddress/GreenBits

wallet.setKeyChainGroupLookaheadSize(5);
wallet.setKeyChainGroupLookaheadThreshold(4);
peerGroup.start();

相关文章

微信公众号

最新文章

更多

Wallet类方法