/** * Gets the active keychain via {@link KeyChainGroup#getActiveKeyChain()} */ public DeterministicKeyChain getActiveKeyChain() { return keyChainGroup.getActiveKeyChain(); }
/** * Gets the active keychain via {@link KeyChainGroup#getActiveKeyChain()} */ public DeterministicKeyChain getActiveKeyChain() { return keyChainGroup.getActiveKeyChain(); }
/** * Gets the current lookahead size being used for ALL deterministic key chains. See * {@link DeterministicKeyChain#setLookaheadSize(int)} * for more information. */ public int getLookaheadSize() { if (lookaheadSize == -1) return getActiveKeyChain().getLookaheadSize(); else return lookaheadSize; }
/** * Gets the current lookahead size being used for ALL deterministic key chains. See * {@link DeterministicKeyChain#setLookaheadSize(int)} * for more information. */ public int getLookaheadSize() { if (lookaheadSize == -1) return getActiveKeyChain().getLookaheadSize(); else return lookaheadSize; }
/** * Returns only the keys that have been issued by {@link #freshReceiveKey()}, {@link #freshReceiveAddress()}, * {@link #currentReceiveKey()} or {@link #currentReceiveAddress()}. */ public List<ECKey> getIssuedReceiveKeys() { keyChainGroupLock.lock(); try { return keyChainGroup.getActiveKeyChain().getIssuedReceiveKeys(); } finally { keyChainGroupLock.unlock(); } }
/** * Returns only the keys that have been issued by {@link #freshReceiveKey()}, {@link #freshReceiveAddress()}, * {@link #currentReceiveKey()} or {@link #currentReceiveAddress()}. */ public List<ECKey> getIssuedReceiveKeys() { keyChainGroupLock.lock(); try { return keyChainGroup.getActiveKeyChain().getIssuedReceiveKeys(); } finally { keyChainGroupLock.unlock(); } }
/** * Gets the current lookahead size being used for ALL deterministic key chains. See * {@link DeterministicKeyChain#setLookaheadSize(int)} * for more information. */ public int getLookaheadSize() { if (lookaheadSize == -1) return getActiveKeyChain().getLookaheadSize(); else return lookaheadSize; }
/** * Gets the current lookahead threshold being used for ALL deterministic key chains. See * {@link DeterministicKeyChain#setLookaheadThreshold(int)} * for more information. */ public int getLookaheadThreshold() { if (lookaheadThreshold == -1) return getActiveKeyChain().getLookaheadThreshold(); else return lookaheadThreshold; }
/** * Whether the active keychain is married. A keychain is married when it vends P2SH addresses * from multiple keychains in a multisig relationship. * @see org.bitcoinj.wallet.MarriedKeyChain */ public final boolean isMarried() { return !chains.isEmpty() && getActiveKeyChain().isMarried(); }
/** * Gets the current lookahead threshold being used for ALL deterministic key chains. See * {@link DeterministicKeyChain#setLookaheadThreshold(int)} * for more information. */ public int getLookaheadThreshold() { if (lookaheadThreshold == -1) return getActiveKeyChain().getLookaheadThreshold(); else return lookaheadThreshold; }
/** * Returns only the keys that have been issued by {@link #freshReceiveKey()}, {@link #freshReceiveAddress()}, * {@link #currentReceiveKey()} or {@link #currentReceiveAddress()}. */ public List<ECKey> getIssuedReceiveKeys() { keyChainGroupLock.lock(); try { return keyChainGroup.getActiveKeyChain().getIssuedReceiveKeys(); } finally { keyChainGroupLock.unlock(); } }
/** * Gets the current lookahead threshold being used for ALL deterministic key chains. See * {@link DeterministicKeyChain#setLookaheadThreshold(int)} * for more information. */ public int getLookaheadThreshold() { if (lookaheadThreshold == -1) return getActiveKeyChain().getLookaheadThreshold(); else return lookaheadThreshold; }
/** * Whether the active keychain is married. A keychain is married when it vends P2SH addresses * from multiple keychains in a multisig relationship. * @see org.bitcoinj.wallet.MarriedKeyChain */ public final boolean isMarried() { return !chains.isEmpty() && getActiveKeyChain().isMarried(); }
public WalletAppKit getKit() { if (kit == null) { kit = initKit(keyChainGroup.getActiveKeyChain().getSeed()); } return kit; }
public boolean checkAESKey(KeyParameter aesKey) { checkState(keyCrypter != null, "Not encrypted"); if (basic.numKeys() > 0) return basic.checkAESKey(aesKey); return getActiveKeyChain().checkAESKey(aesKey); }
public boolean checkAESKey(KeyParameter aesKey) { checkState(keyCrypter != null, "Not encrypted"); if (basic.numKeys() > 0) return basic.checkAESKey(aesKey); return getActiveKeyChain().checkAESKey(aesKey); }
public boolean checkAESKey(KeyParameter aesKey) { checkState(keyCrypter != null, "Not encrypted"); if (basic.numKeys() > 0) return basic.checkAESKey(aesKey); return getActiveKeyChain().checkAESKey(aesKey); }
private KeyChainGroup createMarriedKeyChainGroup() { KeyChainGroup group = new KeyChainGroup(PARAMS); DeterministicKeyChain chain = createMarriedKeyChain(); group.addAndActivateHDChain(chain); group.setLookaheadSize(LOOKAHEAD_SIZE); group.getActiveKeyChain(); return group; }
@Test public void constructFromSeed() throws Exception { ECKey key1 = group.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); final DeterministicSeed seed = checkNotNull(group.getActiveKeyChain().getSeed()); KeyChainGroup group2 = new KeyChainGroup(PARAMS, seed); group2.setLookaheadSize(5); ECKey key2 = group2.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); assertEquals(key1, key2); }
@Before public void setup() { BriefLogFormatter.init(); Utils.setMockClock(); group = new KeyChainGroup(PARAMS); group.setLookaheadSize(LOOKAHEAD_SIZE); // Don't want slow tests. group.getActiveKeyChain(); // Force create a chain. watchingAccountKey = DeterministicKey.deserializeB58(null, XPUB, PARAMS); }