/** * <p>Removes the channel with the given id from this set of stored states and notifies the wallet of an update to * this wallet extension.</p> * * <p>Note that the channel will still have its contract and refund transactions broadcast via the connected * {@link TransactionBroadcaster} as long as this {@link StoredPaymentChannelClientStates} continues to * exist in memory.</p> */ void removeChannel(StoredClientChannel channel) { lock.lock(); try { mapChannels.remove(channel.id, channel); } finally { lock.unlock(); } updatedChannel(channel); }
/** * <p>Removes the channel with the given id from this set of stored states and notifies the wallet of an update to * this wallet extension.</p> * * <p>Note that the channel will still have its contract and refund transactions broadcast via the connected * {@link TransactionBroadcaster} as long as this {@link StoredPaymentChannelClientStates} continues to * exist in memory.</p> */ void removeChannel(StoredClientChannel channel) { lock.lock(); try { mapChannels.remove(channel.id, channel); } finally { lock.unlock(); } updatedChannel(channel); }
/** * <p>Removes the channel with the given id from this set of stored states and notifies the wallet of an update to * this wallet extension.</p> * * <p>Note that the channel will still have its contract and refund transactions broadcast via the connected * {@link TransactionBroadcaster} as long as this {@link StoredPaymentChannelClientStates} continues to * exist in memory.</p> */ void removeChannel(StoredClientChannel channel) { lock.lock(); try { mapChannels.remove(channel.id, channel); } finally { lock.unlock(); } updatedChannel(channel); }
/** * <p>Removes the channel with the given id from this set of stored states and notifies the wallet of an update to * this wallet extension.</p> * * <p>Note that the channel will still have its contract and refund transactions broadcast via the connected * {@link TransactionBroadcaster} as long as this {@link StoredPaymentChannelClientStates} continues to * exist in memory.</p> */ void removeChannel(StoredClientChannel channel) { lock.lock(); try { mapChannels.remove(channel.id, channel); } finally { lock.unlock(); } updatedChannel(channel); }
protected synchronized void updateChannelInWallet() { if (storedChannel == null) return; storedChannel.valueToMe = getValueToMe(); StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); channels.updatedChannel(storedChannel); }
protected synchronized void updateChannelInWallet() { if (storedChannel == null) return; storedChannel.valueToMe = getValueToMe(); StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); channels.updatedChannel(storedChannel); }
protected synchronized void updateChannelInWallet() { if (storedChannel == null) return; storedChannel.valueToMe = getValueToMe(); StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); channels.updatedChannel(storedChannel); }
protected synchronized void updateChannelInWallet() { if (storedChannel == null) return; storedChannel.valueToMe = getValueToMe(); StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates) wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID); channels.updatedChannel(storedChannel); }
private void putChannel(final StoredClientChannel channel, boolean updateWallet) { lock.lock(); try { mapChannels.put(channel.id, channel); channelTimeoutHandler.schedule(new TimerTask() { @Override public void run() { try { TransactionBroadcaster announcePeerGroup = getAnnouncePeerGroup(); removeChannel(channel); announcePeerGroup.broadcastTransaction(channel.contract); announcePeerGroup.broadcastTransaction(channel.refund); } catch (Exception e) { // Something went wrong closing the channel - we catch // here or else we take down the whole Timer. log.error("Auto-closing channel failed", e); } } // Add the difference between real time and Utils.now() so that test-cases can use a mock clock. }, new Date(channel.expiryTimeSeconds() * 1000 + (System.currentTimeMillis() - Utils.currentTimeMillis()))); } finally { lock.unlock(); } if (updateWallet) updatedChannel(channel); }
private void putChannel(final StoredClientChannel channel, boolean updateWallet) { lock.lock(); try { mapChannels.put(channel.id, channel); channelTimeoutHandler.schedule(new TimerTask() { @Override public void run() { try { TransactionBroadcaster announcePeerGroup = getAnnouncePeerGroup(); removeChannel(channel); announcePeerGroup.broadcastTransaction(channel.contract); announcePeerGroup.broadcastTransaction(channel.refund); } catch (Exception e) { // Something went wrong closing the channel - we catch // here or else we take down the whole Timer. log.error("Auto-closing channel failed", e); } } // Add the difference between real time and Utils.now() so that test-cases can use a mock clock. }, new Date(channel.expiryTimeSeconds() * 1000 + (System.currentTimeMillis() - Utils.currentTimeMillis()))); } finally { lock.unlock(); } if (updateWallet) updatedChannel(channel); }
private void putChannel(final StoredClientChannel channel, boolean updateWallet) { lock.lock(); try { mapChannels.put(channel.id, channel); channelTimeoutHandler.schedule(new TimerTask() { @Override public void run() { try { TransactionBroadcaster announcePeerGroup = getAnnouncePeerGroup(); removeChannel(channel); announcePeerGroup.broadcastTransaction(channel.contract); announcePeerGroup.broadcastTransaction(channel.refund); } catch (Exception e) { // Something went wrong closing the channel - we catch // here or else we take down the whole Timer. log.error("Auto-closing channel failed", e); } } // Add the difference between real time and Utils.now() so that test-cases can use a mock clock. }, new Date(channel.expiryTimeSeconds() * 1000 + (System.currentTimeMillis() - Utils.currentTimeMillis()))); } finally { lock.unlock(); } if (updateWallet) updatedChannel(channel); }
private void putChannel(final StoredClientChannel channel, boolean updateWallet) { lock.lock(); try { mapChannels.put(channel.id, channel); channelTimeoutHandler.schedule(new TimerTask() { @Override public void run() { try { TransactionBroadcaster announcePeerGroup = getAnnouncePeerGroup(); removeChannel(channel); announcePeerGroup.broadcastTransaction(channel.contract); announcePeerGroup.broadcastTransaction(channel.refund); } catch (Exception e) { // Something went wrong closing the channel - we catch // here or else we take down the whole Timer. log.error("Auto-closing channel failed", e); } } // Add the difference between real time and Utils.now() so that test-cases can use a mock clock. }, new Date(channel.expiryTimeSeconds() * 1000 + (System.currentTimeMillis() - Utils.currentTimeMillis()))); } finally { lock.unlock(); } if (updateWallet) updatedChannel(channel); }