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())); }
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())); }
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())); } }
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())); } }