code: public void putChannel(final StoredServerChannel channel) {
          lock.lock();
          try {
              checkArgument(mapChannels.put(channel.contract.getTxId(), checkNotNull(channel)) == null);
              // Add the difference between real time and Utils.now() so that test-cases can use a mock clock.
              Date autocloseTime = new Date((channel.refundTransactionUnlockTimeSecs + CHANNEL_EXPIRE_OFFSET) * 1000L
                      + (System.currentTimeMillis() - Utils.currentTimeMillis()));
              log.info("Scheduling channel for automatic closure at {}: {}", autocloseTime, channel);
              channelTimeoutHandler.schedule(new TimerTask() {
                  @Override
                  public void run() {
                      log.info("Auto-closing channel: {}", channel);
                      try {
                          closeChannel(channel);
                      } 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);
                      }
                  }
              }, autocloseTime);
          } finally {
              lock.unlock();
          }
          updatedChannel(channel);
      }
docs: <p>Puts the given channel in the channels map and automatically closes it 2 hours before its refund transaction
  becomes spendable.</p>
  
  <p>Because there must be only one, canonical {@link StoredServerChannel} per channel, this method throws if the
  channel is already present in the set of channels.</p>