Search in sources :

Example 1 with MixDestination

use of com.samourai.whirlpool.client.mix.handler.MixDestination in project sparrow by sparrowwallet.

the class SparrowPostmixHandler method computeNextDestination.

protected MixDestination computeNextDestination() throws Exception {
    // index
    int index = Math.max(getIndexHandler().getAndIncrementUnconfirmed(), startIndex);
    // address
    WalletNode node = new WalletNode(wallet, keyPurpose, index);
    Address address = node.getAddress();
    String path = XPubUtil.getInstance().getPath(index, keyPurpose.getPathIndex().num());
    log.info("Mixing to external xPub -> receiveAddress=" + address + ", path=" + path);
    return new MixDestination(DestinationType.XPUB, index, address.toString(), path);
}
Also used : Address(com.sparrowwallet.drongo.address.Address) MixDestination(com.samourai.whirlpool.client.mix.handler.MixDestination) WalletNode(com.sparrowwallet.drongo.wallet.WalletNode)

Aggregations

MixDestination (com.samourai.whirlpool.client.mix.handler.MixDestination)1 Address (com.sparrowwallet.drongo.address.Address)1 WalletNode (com.sparrowwallet.drongo.wallet.WalletNode)1