本文整理匯總了Java中org.bitcoinj.core.UTXOProvider類的典型用法代碼示例。如果您正苦於以下問題:Java UTXOProvider類的具體用法?Java UTXOProvider怎麽用?Java UTXOProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
UTXOProvider類屬於org.bitcoinj.core包,在下文中一共展示了UTXOProvider類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getStoredOutputsFromUTXOProvider
import org.bitcoinj.core.UTXOProvider; //導入依賴的package包/類
/**
* Get all the {@link UTXO}'s from the {@link UTXOProvider} based on keys that the
* wallet contains.
* @return The list of stored outputs.
*/
protected List<UTXO> getStoredOutputsFromUTXOProvider() throws UTXOProviderException {
UTXOProvider utxoProvider = checkNotNull(vUTXOProvider, "No UTXO provider has been set");
List<UTXO> candidates = new ArrayList<>();
List<ECKey> keys = getImportedKeys();
keys.addAll(getActiveKeyChain().getLeafKeys());
List<Address> addresses = new ArrayList<>();
for (ECKey key : keys) {
Address address = new Address(params, key.getPubKeyHash());
addresses.add(address);
}
candidates.addAll(utxoProvider.getOpenTransactionOutputs(addresses));
return candidates;
}
示例2: getUTXOProvider
import org.bitcoinj.core.UTXOProvider; //導入依賴的package包/類
/**
* Get the {@link UTXOProvider}.
* @return The UTXO provider.
*/
@Nullable public UTXOProvider getUTXOProvider() {
lock.lock();
try {
return vUTXOProvider;
} finally {
lock.unlock();
}
}
示例3: setUTXOProvider
import org.bitcoinj.core.UTXOProvider; //導入依賴的package包/類
/**
* Set the {@link UTXOProvider}.
*
* <p>The wallet will query the provider for spendable candidates, i.e. outputs controlled exclusively
* by private keys contained in the wallet.</p>
*
* <p>Note that the associated provider must be reattached after a wallet is loaded from disk.
* The association is not serialized.</p>
*/
public void setUTXOProvider(@Nullable UTXOProvider provider) {
lock.lock();
try {
checkArgument(provider == null || provider.getParams().equals(params));
this.vUTXOProvider = provider;
} finally {
lock.unlock();
}
}
示例4: getStoredOutputsFromUTXOProvider
import org.bitcoinj.core.UTXOProvider; //導入依賴的package包/類
/**
* Get all the {@link UTXO}'s from the {@link UTXOProvider} based on keys that the
* wallet contains.
* @return The list of stored outputs.
*/
protected List<UTXO> getStoredOutputsFromUTXOProvider() throws UTXOProviderException {
UTXOProvider utxoProvider = checkNotNull(vUTXOProvider, "No UTXO provider has been set");
List<UTXO> candidates = new ArrayList<UTXO>();
List<ECKey> keys = getImportedKeys();
keys.addAll(getActiveKeyChain().getLeafKeys());
List<Address> addresses = new ArrayList<Address>();
for (ECKey key : keys) {
Address address = new Address(params, key.getPubKeyHash());
addresses.add(address);
}
candidates.addAll(utxoProvider.getOpenTransactionOutputs(addresses));
return candidates;
}