@GuardedBy("lock") private void receiveClose(Protos.TwoWayChannelMessage msg) throws VerificationException { checkState(lock.isHeldByCurrentThread()); if (msg.hasSettlement()) { Transaction settleTx = wallet.getParams().getDefaultSerializer().makeTransaction(msg.getSettlement().getTx().toByteArray()); log.info("CLOSE message received with settlement tx {}", settleTx.getHash()); // TODO: set source if (state != null && state().isSettlementTransaction(settleTx)) { // The wallet has a listener on it that the state object will use to do the right thing at this // point (like watching it for confirmations). The tx has been checked by now for syntactical validity // and that it correctly spends the multisig contract. wallet.receivePending(settleTx, null); } } else { log.info("CLOSE message received without settlement tx"); } if (step == InitStep.WAITING_FOR_CHANNEL_CLOSE) conn.destroyConnection(CloseReason.CLIENT_REQUESTED_CLOSE); else conn.destroyConnection(CloseReason.SERVER_REQUESTED_CLOSE); step = InitStep.CHANNEL_CLOSED; }
@GuardedBy("lock") private void receiveClose(Protos.TwoWayChannelMessage msg) throws VerificationException { checkState(lock.isHeldByCurrentThread()); if (msg.hasSettlement()) { Transaction settleTx = wallet.getParams().getDefaultSerializer().makeTransaction(msg.getSettlement().getTx().toByteArray()); log.info("CLOSE message received with settlement tx {}", settleTx.getHash()); // TODO: set source if (state != null && state().isSettlementTransaction(settleTx)) { // The wallet has a listener on it that the state object will use to do the right thing at this // point (like watching it for confirmations). The tx has been checked by now for syntactical validity // and that it correctly spends the multisig contract. wallet.receivePending(settleTx, null); } } else { log.info("CLOSE message received without settlement tx"); } if (step == InitStep.WAITING_FOR_CHANNEL_CLOSE) conn.destroyConnection(CloseReason.CLIENT_REQUESTED_CLOSE); else conn.destroyConnection(CloseReason.SERVER_REQUESTED_CLOSE); step = InitStep.CHANNEL_CLOSED; }
@GuardedBy("lock") private void receiveClose(Protos.TwoWayChannelMessage msg) throws VerificationException { checkState(lock.isHeldByCurrentThread()); if (msg.hasSettlement()) { Transaction settleTx = wallet.getParams().getDefaultSerializer().makeTransaction(msg.getSettlement().getTx().toByteArray()); log.info("CLOSE message received with settlement tx {}", settleTx.getHash()); // TODO: set source if (state != null && state().isSettlementTransaction(settleTx)) { // The wallet has a listener on it that the state object will use to do the right thing at this // point (like watching it for confirmations). The tx has been checked by now for syntactical validity // and that it correctly spends the multisig contract. wallet.receivePending(settleTx, null); } } else { log.info("CLOSE message received without settlement tx"); } if (step == InitStep.WAITING_FOR_CHANNEL_CLOSE) conn.destroyConnection(CloseReason.CLIENT_REQUESTED_CLOSE); else conn.destroyConnection(CloseReason.SERVER_REQUESTED_CLOSE); step = InitStep.CHANNEL_CLOSED; }
@GuardedBy("lock") private void receiveClose(Protos.TwoWayChannelMessage msg) throws VerificationException { checkState(lock.isHeldByCurrentThread()); if (msg.hasSettlement()) { Transaction settleTx = wallet.getParams().getDefaultSerializer().makeTransaction(msg.getSettlement().getTx().toByteArray()); log.info("CLOSE message received with settlement tx {}", settleTx.getHash()); // TODO: set source if (state != null && state().isSettlementTransaction(settleTx)) { // The wallet has a listener on it that the state object will use to do the right thing at this // point (like watching it for confirmations). The tx has been checked by now for syntactical validity // and that it correctly spends the multisig contract. wallet.receivePending(settleTx, null); } } else { log.info("CLOSE message received without settlement tx"); } if (step == InitStep.WAITING_FOR_CHANNEL_CLOSE) conn.destroyConnection(CloseReason.CLIENT_REQUESTED_CLOSE); else conn.destroyConnection(CloseReason.SERVER_REQUESTED_CLOSE); step = InitStep.CHANNEL_CLOSED; }
@Override public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { synchronized (PaymentChannelClientState.this) { if (getContractInternal() == null) return; if (isSettlementTransaction(tx)) { log.info("Close: transaction {} closed contract {}", tx.getHash(), getContractInternal().getHash()); // Record the fact that it was closed along with the transaction that closed it. stateMachine.transition(State.CLOSED); if (storedChannel == null) return; storedChannel.close = tx; updateChannelInWallet(); watchCloseConfirmations(); } } } });
@Override public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { synchronized (PaymentChannelClientState.this) { if (getContractInternal() == null) return; if (isSettlementTransaction(tx)) { log.info("Close: transaction {} closed contract {}", tx.getHash(), getContractInternal().getHash()); // Record the fact that it was closed along with the transaction that closed it. stateMachine.transition(State.CLOSED); if (storedChannel == null) return; storedChannel.close = tx; updateChannelInWallet(); watchCloseConfirmations(); } } } });
@Override public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { synchronized (PaymentChannelClientState.this) { if (getContractInternal() == null) return; if (isSettlementTransaction(tx)) { log.info("Close: transaction {} closed contract {}", tx.getHash(), getContractInternal().getHash()); // Record the fact that it was closed along with the transaction that closed it. stateMachine.transition(State.CLOSED); if (storedChannel == null) return; storedChannel.close = tx; updateChannelInWallet(); watchCloseConfirmations(); } } } });
@Override public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { synchronized (PaymentChannelClientState.this) { if (getContractInternal() == null) return; if (isSettlementTransaction(tx)) { log.info("Close: transaction {} closed contract {}", tx.getHash(), getContractInternal().getHash()); // Record the fact that it was closed along with the transaction that closed it. stateMachine.transition(State.CLOSED); if (storedChannel == null) return; storedChannel.close = tx; updateChannelInWallet(); watchCloseConfirmations(); } } } });