當前位置: 首頁>>代碼示例>>Java>>正文


Java UTXOProvider類代碼示例

本文整理匯總了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;
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:19,代碼來源:Wallet.java

示例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();
    }
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:13,代碼來源:Wallet.java

示例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();
    }
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:19,代碼來源:Wallet.java

示例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;
}
 
開發者ID:Grant-Redmond,項目名稱:cryptwallet,代碼行數:19,代碼來源:Wallet.java


注:本文中的org.bitcoinj.core.UTXOProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。