Search in sources :

Example 1 with RskAllowUnconfirmedCoinSelector

use of co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector in project rskj by rsksmart.

the class BridgeUtils method getFederationsSpendWallet.

public static Wallet getFederationsSpendWallet(Context btcContext, List<Federation> federations, List<UTXO> utxos, boolean isFastBridgeCompatible, BridgeStorageProvider storageProvider) {
    Wallet wallet;
    if (isFastBridgeCompatible) {
        wallet = new FastBridgeCompatibleBtcWalletWithStorage(btcContext, federations, storageProvider);
    } else {
        wallet = new BridgeBtcWallet(btcContext, federations);
    }
    RskUTXOProvider utxoProvider = new RskUTXOProvider(btcContext.getParams(), utxos);
    wallet.setUTXOProvider(utxoProvider);
    federations.forEach(federation -> wallet.addWatchedAddress(federation.getAddress(), federation.getCreationTime().toEpochMilli()));
    wallet.setCoinSelector(new RskAllowUnconfirmedCoinSelector());
    return wallet;
}
Also used : Wallet(co.rsk.bitcoinj.wallet.Wallet) RskAllowUnconfirmedCoinSelector(co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector)

Example 2 with RskAllowUnconfirmedCoinSelector

use of co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector in project rskj by rsksmart.

the class BridgeUtils method getFederationsSpendWallet.

public static Wallet getFederationsSpendWallet(Context btcContext, List<Federation> federations, List<UTXO> utxos) {
    Wallet wallet = new BridgeBtcWallet(btcContext, federations);
    RskUTXOProvider utxoProvider = new RskUTXOProvider(btcContext.getParams(), utxos);
    wallet.setUTXOProvider(utxoProvider);
    federations.stream().forEach(federation -> {
        wallet.addWatchedAddress(federation.getAddress(), federation.getCreationTime().toEpochMilli());
    });
    wallet.setCoinSelector(new RskAllowUnconfirmedCoinSelector());
    return wallet;
}
Also used : Wallet(co.rsk.bitcoinj.wallet.Wallet) RskAllowUnconfirmedCoinSelector(co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector)

Example 3 with RskAllowUnconfirmedCoinSelector

use of co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector in project rskj by rsksmart.

the class BridgeSupport method getFastBridgeWallet.

protected Wallet getFastBridgeWallet(Context btcContext, List<UTXO> utxos, FastBridgeFederationInformation fb) {
    Wallet wallet = new FastBridgeCompatibleBtcWalletWithSingleScript(btcContext, getLiveFederations(), fb);
    RskUTXOProvider utxoProvider = new RskUTXOProvider(btcContext.getParams(), utxos);
    wallet.setUTXOProvider(utxoProvider);
    wallet.setCoinSelector(new RskAllowUnconfirmedCoinSelector());
    return wallet;
}
Also used : Wallet(co.rsk.bitcoinj.wallet.Wallet) RskAllowUnconfirmedCoinSelector(co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector)

Aggregations

Wallet (co.rsk.bitcoinj.wallet.Wallet)3 RskAllowUnconfirmedCoinSelector (co.rsk.peg.bitcoin.RskAllowUnconfirmedCoinSelector)3