docs: private void maybeMarkCurrentKeyAsUsed(DeterministicKey key) {
          // It's OK for currentKeys to be empty here: it means we're a married wallet and the key may be a part of a
          // rotating chain.
          for (Map.Entry<KeyChain.KeyPurpose, DeterministicKey> entry : currentKeys.entrySet()) {
              if (entry.getValue() != null && entry.getValue().equals(key)) {
                  log.info("Marking key as used: {}", key);
                  currentKeys.put(entry.getKey(), freshKey(entry.getKey()));
                  return;
              }
          }
      }