Java Code Examples for org.bitcoin.paymentchannel.Protos#PaymentAck

The following examples show how to use org.bitcoin.paymentchannel.Protos#PaymentAck . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PaymentChannelClient.java    From bcm-android with GNU General Public License v3.0 6 votes vote down vote up
private void receivePaymentAck(Protos.PaymentAck paymentAck) {
    SettableFuture<PaymentIncrementAck> future;
    Coin value;

    lock.lock();
    try {
        if (increasePaymentFuture == null)
            return;
        checkNotNull(increasePaymentFuture, "Server sent a PAYMENT_ACK with no outstanding payment");
        log.info("Received a PAYMENT_ACK from the server");
        future = increasePaymentFuture;
        value = lastPaymentActualAmount;
    } finally {
        lock.unlock();
    }

    // Ensure the future runs without the client lock held.
    future.set(new PaymentIncrementAck(value, paymentAck.getInfo()));
}
 
Example 2
Source File: PaymentChannelClient.java    From green_android with GNU General Public License v3.0 6 votes vote down vote up
private void receivePaymentAck(Protos.PaymentAck paymentAck) {
    SettableFuture<PaymentIncrementAck> future;
    Coin value;

    lock.lock();
    try {
        if (increasePaymentFuture == null) return;
        checkNotNull(increasePaymentFuture, "Server sent a PAYMENT_ACK with no outstanding payment");
        log.info("Received a PAYMENT_ACK from the server");
        future = increasePaymentFuture;
        value = lastPaymentActualAmount;
    } finally {
        lock.unlock();
    }

    // Ensure the future runs without the client lock held.
    future.set(new PaymentIncrementAck(value, paymentAck.getInfo()));
}
 
Example 3
Source File: PaymentChannelClient.java    From GreenBits with GNU General Public License v3.0 6 votes vote down vote up
private void receivePaymentAck(Protos.PaymentAck paymentAck) {
    SettableFuture<PaymentIncrementAck> future;
    Coin value;

    lock.lock();
    try {
        if (increasePaymentFuture == null) return;
        checkNotNull(increasePaymentFuture, "Server sent a PAYMENT_ACK with no outstanding payment");
        log.info("Received a PAYMENT_ACK from the server");
        future = increasePaymentFuture;
        value = lastPaymentActualAmount;
    } finally {
        lock.unlock();
    }

    // Ensure the future runs without the client lock held.
    future.set(new PaymentIncrementAck(value, paymentAck.getInfo()));
}