Package com.google.bitcoin.protocols.channels

Examples of com.google.bitcoin.protocols.channels.StoredPaymentChannelClientStates


        // Create the app kit. It won't do any heavyweight initialization until after we start it.
        bitcoin = new WalletAppKit(params, new File("."), filePrefix + APP_NAME ) {
            @Override
            protected void addWalletExtensions() throws Exception {
                super.addWalletExtensions();
                wallet().addExtension(new StoredPaymentChannelClientStates(wallet(), peerGroup()));
            }
        };
        if (params == RegTestParams.get()) {
            bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
        } else if (params == MainNetParams.get()) {
View Full Code Here


    /**
     * Returns balance of the wallet plus whatever is left in the current channel, i.e. how much money is spendable
     * after a clean disconnect.
     */
    public BigInteger getRemainingBalance() {
        final StoredPaymentChannelClientStates extension = StoredPaymentChannelClientStates.getFromWallet(wallet);
        checkNotNull(extension);
        BigInteger valueRefunded = extension.getBalanceForServer(getServerID());
        return wallet.getBalance().add(valueRefunded);
    }
View Full Code Here

    /**
     * Returns how much money is still stuck in a channel with the given server. Does NOT include wallet balance.
     */
    public static BigInteger getBalanceForServer(String serverName, int port, Wallet wallet) {
        final StoredPaymentChannelClientStates extension = StoredPaymentChannelClientStates.getFromWallet(wallet);
        checkNotNull(extension);
        return extension.getBalanceForServer(getServerID(serverName, port));
    }
View Full Code Here

    /**
     * Returns how long you have to wait until this channel will either be settled by the server, or can be auto-settled
     * by the client (us).
     */
    public static long getSecondsUntilExpiry(String serverName, int port, Wallet wallet) {
        final StoredPaymentChannelClientStates extension = StoredPaymentChannelClientStates.getFromWallet(wallet);
        checkNotNull(extension);
        return extension.getSecondsUntilExpiry(getServerID(serverName, port));
    }
View Full Code Here

    public CLI(Socket socket) throws IOException {
        appkit = new WalletAppKit(params, new File("."), filePrefix + "payfile-cli") {
            @Override
            protected void addWalletExtensions() throws Exception {
                super.addWalletExtensions();
                wallet().addExtension(new StoredPaymentChannelClientStates(wallet(), peerGroup()));
            }
        };

        if (params == RegTestParams.get()) {
            appkit.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
View Full Code Here

TOP

Related Classes of com.google.bitcoin.protocols.channels.StoredPaymentChannelClientStates

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.