/** * <code>repeated .wallet.Extension extension = 10;</code> */ public Builder addExtension( int index, org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExtensionIsMutable(); extension_.add(index, value); onChanged(); } else { extensionBuilder_.addMessage(index, value); } return this; } /**
/** * <code>repeated .wallet.Key key = 3;</code> */ public Builder addKey(org.bitcoinj.wallet.Protos.Key value) { if (keyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureKeyIsMutable(); key_.add(value); onChanged(); } else { keyBuilder_.addMessage(value); } return this; } /**
bitField0_ |= 0x00000001; networkIdentifier_ = other.networkIdentifier_; onChanged(); setLastSeenBlockHash(other.getLastSeenBlockHash()); setLastSeenBlockHeight(other.getLastSeenBlockHeight()); setLastSeenBlockTimeSecs(other.getLastSeenBlockTimeSecs()); bitField0_ = (bitField0_ & ~0x00000010); } else { ensureKeyIsMutable(); key_.addAll(other.key_); onChanged(); keyBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getKeyFieldBuilder() : null; } else { keyBuilder_.addAllMessages(other.key_); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionIsMutable(); transaction_.addAll(other.transaction_); onChanged();
bitField0_ |= 0x00000001; networkIdentifier_ = other.networkIdentifier_; onChanged(); setLastSeenBlockHash(other.getLastSeenBlockHash()); setLastSeenBlockHeight(other.getLastSeenBlockHeight()); setLastSeenBlockTimeSecs(other.getLastSeenBlockTimeSecs()); bitField0_ = (bitField0_ & ~0x00000010); } else { ensureKeyIsMutable(); key_.addAll(other.key_); onChanged(); keyBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getKeyFieldBuilder() : null; } else { keyBuilder_.addAllMessages(other.key_); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionIsMutable(); transaction_.addAll(other.transaction_); onChanged();
bitField0_ |= 0x00000001; networkIdentifier_ = other.networkIdentifier_; onChanged(); setLastSeenBlockHash(other.getLastSeenBlockHash()); setLastSeenBlockHeight(other.getLastSeenBlockHeight()); setLastSeenBlockTimeSecs(other.getLastSeenBlockTimeSecs()); bitField0_ = (bitField0_ & ~0x00000010); } else { ensureKeyIsMutable(); key_.addAll(other.key_); onChanged(); keyBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getKeyFieldBuilder() : null; } else { keyBuilder_.addAllMessages(other.key_); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionIsMutable(); transaction_.addAll(other.transaction_); onChanged();
bitField0_ |= 0x00000001; networkIdentifier_ = other.networkIdentifier_; onChanged(); setLastSeenBlockHash(other.getLastSeenBlockHash()); setLastSeenBlockHeight(other.getLastSeenBlockHeight()); setLastSeenBlockTimeSecs(other.getLastSeenBlockTimeSecs()); bitField0_ = (bitField0_ & ~0x00000010); } else { ensureKeyIsMutable(); key_.addAll(other.key_); onChanged(); keyBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getKeyFieldBuilder() : null; } else { keyBuilder_.addAllMessages(other.key_); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionIsMutable(); transaction_.addAll(other.transaction_); onChanged();
bitField0_ |= 0x00000001; networkIdentifier_ = other.networkIdentifier_; onChanged(); setLastSeenBlockHash(other.getLastSeenBlockHash()); setLastSeenBlockHeight(other.getLastSeenBlockHeight()); setLastSeenBlockTimeSecs(other.getLastSeenBlockTimeSecs()); bitField0_ = (bitField0_ & ~0x00000010); } else { ensureKeyIsMutable(); key_.addAll(other.key_); onChanged(); keyBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getKeyFieldBuilder() : null; } else { keyBuilder_.addAllMessages(other.key_); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionIsMutable(); transaction_.addAll(other.transaction_); onChanged();
walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); walletBuilder.addTransaction(txProto); walletBuilder.addKey(keyBuilder); walletBuilder.addWatchedScript(protoScript); walletBuilder.setLastSeenBlockHash(hashToByteString(lastSeenBlockHash)); walletBuilder.setLastSeenBlockHeight(wallet.getLastBlockSeenHeight()); walletBuilder.setLastSeenBlockTimeSecs(wallet.getLastBlockSeenTimeSecs()); walletBuilder.setEncryptionType(EncryptionType.UNENCRYPTED); } else { walletBuilder.setEncryptionType(keyCrypter.getUnderstoodEncryptionType()); if (keyCrypter instanceof KeyCrypterScrypt) { KeyCrypterScrypt keyCrypterScrypt = (KeyCrypterScrypt) keyCrypter; walletBuilder.setEncryptionParameters(keyCrypterScrypt.getScryptParameters()); } else { walletBuilder.setKeyRotationTime(timeSecs); walletBuilder.setVersion(wallet.getVersion()); return walletBuilder.build();
walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); walletBuilder.addTransaction(txProto); walletBuilder.addAllKey(wallet.serializeKeyChainGroupToProtobuf()); walletBuilder.addWatchedScript(protoScript); walletBuilder.setLastSeenBlockHash(hashToByteString(lastSeenBlockHash)); walletBuilder.setLastSeenBlockHeight(wallet.getLastBlockSeenHeight()); walletBuilder.setLastSeenBlockTimeSecs(wallet.getLastBlockSeenTimeSecs()); walletBuilder.setEncryptionType(EncryptionType.UNENCRYPTED); } else { walletBuilder.setEncryptionType(keyCrypter.getUnderstoodEncryptionType()); if (keyCrypter instanceof KeyCrypterScrypt) { KeyCrypterScrypt keyCrypterScrypt = (KeyCrypterScrypt) keyCrypter; walletBuilder.setEncryptionParameters(keyCrypterScrypt.getScryptParameters()); } else { walletBuilder.setKeyRotationTime(timeSecs); walletBuilder.addTags(tag); protoSigner.setClassName(signer.getClass().getName());
walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); walletBuilder.addTransaction(txProto); walletBuilder.addAllKey(wallet.serializeKeyChainGroupToProtobuf()); walletBuilder.addWatchedScript(protoScript); walletBuilder.setLastSeenBlockHash(hashToByteString(lastSeenBlockHash)); walletBuilder.setLastSeenBlockHeight(wallet.getLastBlockSeenHeight()); walletBuilder.setLastSeenBlockTimeSecs(wallet.getLastBlockSeenTimeSecs()); walletBuilder.setEncryptionType(EncryptionType.UNENCRYPTED); } else { walletBuilder.setEncryptionType(keyCrypter.getUnderstoodEncryptionType()); if (keyCrypter instanceof KeyCrypterScrypt) { KeyCrypterScrypt keyCrypterScrypt = (KeyCrypterScrypt) keyCrypter; walletBuilder.setEncryptionParameters(keyCrypterScrypt.getScryptParameters()); } else { walletBuilder.setKeyRotationTime(timeSecs); walletBuilder.addTags(tag); protoSigner.setClassName(signer.getClass().getName());
walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); walletBuilder.addTransaction(txProto); walletBuilder.addAllKey(wallet.serializeKeyChainGroupToProtobuf()); walletBuilder.addWatchedScript(protoScript); walletBuilder.setLastSeenBlockHash(hashToByteString(lastSeenBlockHash)); walletBuilder.setLastSeenBlockHeight(wallet.getLastBlockSeenHeight()); walletBuilder.setLastSeenBlockTimeSecs(wallet.getLastBlockSeenTimeSecs()); walletBuilder.setEncryptionType(EncryptionType.UNENCRYPTED); } else { walletBuilder.setEncryptionType(keyCrypter.getUnderstoodEncryptionType()); if (keyCrypter instanceof KeyCrypterScrypt) { KeyCrypterScrypt keyCrypterScrypt = (KeyCrypterScrypt) keyCrypter; walletBuilder.setEncryptionParameters(keyCrypterScrypt.getScryptParameters()); } else { walletBuilder.setKeyRotationTime(timeSecs); walletBuilder.addTags(tag); protoSigner.setClassName(signer.getClass().getName());
walletBuilder.setNetworkIdentifier(wallet.getNetworkParameters().getId()); if (wallet.getDescription() != null) { walletBuilder.setDescription(wallet.getDescription()); walletBuilder.addTransaction(txProto); walletBuilder.addAllKey(wallet.serializeKeyChainGroupToProtobuf()); walletBuilder.addWatchedScript(protoScript); walletBuilder.setLastSeenBlockHash(hashToByteString(lastSeenBlockHash)); walletBuilder.setLastSeenBlockHeight(wallet.getLastBlockSeenHeight()); walletBuilder.setLastSeenBlockTimeSecs(wallet.getLastBlockSeenTimeSecs()); walletBuilder.setEncryptionType(EncryptionType.UNENCRYPTED); } else { walletBuilder.setEncryptionType(keyCrypter.getUnderstoodEncryptionType()); if (keyCrypter instanceof KeyCrypterScrypt) { KeyCrypterScrypt keyCrypterScrypt = (KeyCrypterScrypt) keyCrypter; walletBuilder.setEncryptionParameters(keyCrypterScrypt.getScryptParameters()); } else { walletBuilder.setKeyRotationTime(timeSecs); walletBuilder.addTags(tag); protoSigner.setClassName(signer.getClass().getName());
private static Protos.Wallet attemptHexConversion(Protos.Wallet proto) { // Try to convert any raw hashes and such to textual equivalents for easier debugging. This makes it a bit // less "raw" but we will just abort on any errors. try { Protos.Wallet.Builder builder = proto.toBuilder(); for (Protos.Transaction.Builder tx : builder.getTransactionBuilderList()) { tx.setHash(bytesToHex(tx.getHash())); for (int i = 0; i < tx.getBlockHashCount(); i++) tx.setBlockHash(i, bytesToHex(tx.getBlockHash(i))); for (Protos.TransactionInput.Builder input : tx.getTransactionInputBuilderList()) input.setTransactionOutPointHash(bytesToHex(input.getTransactionOutPointHash())); for (Protos.TransactionOutput.Builder output : tx.getTransactionOutputBuilderList()) { if (output.hasSpentByTransactionHash()) output.setSpentByTransactionHash(bytesToHex(output.getSpentByTransactionHash())); } // TODO: keys, ip addresses etc. } return builder.build(); } catch (Throwable throwable) { log.error("Failed to do hex conversion on wallet proto", throwable); return proto; } }
/** * <code>repeated .wallet.Extension extension = 10;</code> */ public Builder setExtension( int index, org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExtensionIsMutable(); extension_.set(index, value); onChanged(); } else { extensionBuilder_.setMessage(index, value); } return this; } /**
/** * <code>repeated .wallet.Extension extension = 10;</code> */ public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExtensionIsMutable(); extension_.add(value); onChanged(); } else { extensionBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .wallet.Extension extension = 10;</code> */ public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExtensionIsMutable(); extension_.add(value); onChanged(); } else { extensionBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .wallet.Extension extension = 10;</code> */ public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExtensionIsMutable(); extension_.add(value); onChanged(); } else { extensionBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .wallet.Key key = 3;</code> */ public Builder addKey( int index, org.bitcoinj.wallet.Protos.Key value) { if (keyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureKeyIsMutable(); key_.add(index, value); onChanged(); } else { keyBuilder_.addMessage(index, value); } return this; } /**
/** * <code>repeated .wallet.Extension extension = 10;</code> */ public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureExtensionIsMutable(); extension_.add(value); onChanged(); } else { extensionBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .wallet.Key key = 3;</code> */ public Builder addKey(org.bitcoinj.wallet.Protos.Key value) { if (keyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureKeyIsMutable(); key_.add(value); onChanged(); } else { keyBuilder_.addMessage(value); } return this; } /**