ecKey = ECKey.fromPublicOnly(pub); ecKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); importKeyLocked(ecKey);
ecKey = ECKey.fromPublicOnly(pub); ecKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); importKeyLocked(ecKey);
ecKey = ECKey.fromPublicOnly(pub); ecKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); importKeyLocked(ecKey);
chain = null; long timestamp = key.getCreationTimestamp() / 1000; if (seed == null) { DeterministicKey accountKey = new DeterministicKey(immutablePath, chainCode, pubkey, null, null); accountKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); chain = factory.makeWatchingKeyChain(key, iter.peek(), accountKey, isFollowingKey, isMarried); isWatchingAccountKey = true; detkey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); if (log.isDebugEnabled()) log.debug("Deserializing: DETERMINISTIC_KEY: {}", detkey);
chain = null; long timestamp = key.getCreationTimestamp() / 1000; if (seed == null) { DeterministicKey accountKey = new DeterministicKey(immutablePath, chainCode, pubkey, null, null); accountKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); chain = factory.makeWatchingKeyChain(key, iter.peek(), accountKey, isFollowingKey, isMarried, useSegwit); isWatchingAccountKey = true; detkey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); if (log.isDebugEnabled()) log.debug("Deserializing: DETERMINISTIC_KEY: {}", detkey);
chain = null; long timestamp = key.getCreationTimestamp() / 1000; if (seed == null) { DeterministicKey accountKey = new DeterministicKey(immutablePath, chainCode, pubkey, null, null); accountKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); chain = factory.makeWatchingKeyChain(key, iter.peek(), accountKey, isFollowingKey, isMarried); isWatchingAccountKey = true; detkey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); if (log.isDebugEnabled()) log.debug("Deserializing: DETERMINISTIC_KEY: {}", detkey);
chain = null; long timestamp = key.getCreationTimestamp() / 1000; if (seed == null) { DeterministicKey accountKey = new DeterministicKey(immutablePath, chainCode, pubkey, null, null); accountKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); chain = factory.makeWatchingKeyChain(key, iter.peek(), accountKey, isFollowingKey, isMarried); isWatchingAccountKey = true; detkey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); if (log.isDebugEnabled()) log.debug("Deserializing: DETERMINISTIC_KEY: {}", detkey);
ecKey.setCreationTimeSeconds((keyProto.getCreationTimestamp() + 500) / 1000); wallet.addKey(ecKey);
setCreationTimestamp(other.getCreationTimestamp());
ecKey = ECKey.fromPublicOnly(pub); ecKey.setCreationTimeSeconds(key.getCreationTimestamp() / 1000); importKeyLocked(ecKey);
setCreationTimestamp(other.getCreationTimestamp());
setCreationTimestamp(other.getCreationTimestamp());
setCreationTimestamp(other.getCreationTimestamp());
@Test public void serializationUnencrypted() throws UnreadableWalletException { Utils.setMockClock(); Date now = Utils.now(); final ECKey key1 = new ECKey(); Utils.rollMockClock(5000); final ECKey key2 = new ECKey(); chain.importKeys(ImmutableList.of(key1, key2)); List<Protos.Key> keys = chain.serializeToProtobuf(); assertEquals(2, keys.size()); assertArrayEquals(key1.getPubKey(), keys.get(0).getPublicKey().toByteArray()); assertArrayEquals(key2.getPubKey(), keys.get(1).getPublicKey().toByteArray()); assertArrayEquals(key1.getPrivKeyBytes(), keys.get(0).getSecretBytes().toByteArray()); assertArrayEquals(key2.getPrivKeyBytes(), keys.get(1).getSecretBytes().toByteArray()); long normTime = (long) (Math.floor(now.getTime() / 1000) * 1000); assertEquals(normTime, keys.get(0).getCreationTimestamp()); assertEquals(normTime + 5000 * 1000, keys.get(1).getCreationTimestamp()); chain = BasicKeyChain.fromProtobufUnencrypted(keys); assertEquals(2, chain.getKeys().size()); assertEquals(key1, chain.getKeys().get(0)); assertEquals(key2, chain.getKeys().get(1)); }
public Builder mergeFrom(org.bitcoinj.wallet.Protos.Key other) { if (other == org.bitcoinj.wallet.Protos.Key.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasPrivateKey()) { setPrivateKey(other.getPrivateKey()); } if (other.hasEncryptedPrivateKey()) { mergeEncryptedPrivateKey(other.getEncryptedPrivateKey()); } if (other.hasPublicKey()) { setPublicKey(other.getPublicKey()); } if (other.hasLabel()) { bitField0_ |= 0x00000010; label_ = other.label_; onChanged(); } if (other.hasCreationTimestamp()) { setCreationTimestamp(other.getCreationTimestamp()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }