docs: public synchronized byte[] provideRefundTransaction(Transaction refundTx, byte[] clientMultiSigPubKey) throws VerificationException {
          checkNotNull(refundTx);
          checkNotNull(clientMultiSigPubKey);
          stateMachine.checkState(State.WAITING_FOR_REFUND_TRANSACTION);
          log.info("Provided with refund transaction: {}", refundTx);
          // Do a few very basic syntax sanity checks.
          refundTx.verify();
          // Verify that the refund transaction has a single input (that we can fill to sign the multisig output).
          if (refundTx.getInputs().size() != 1)
              throw new VerificationException("Refund transaction does not have exactly one input");
          // Verify that the refund transaction has a time lock on it and a sequence number that does not disable lock time.
          if (refundTx.getInput(0).getSequenceNumber() == TransactionInput.NO_SEQUENCE)
              throw new VerificationException("Refund transaction's input's sequence number disables lock time");
          if (refundTx.getLockTime() < minExpireTime)
              throw new VerificationException("Refund transaction has a lock time too soon");
          // Verify the transaction has one output (we don't care about its contents, its up to the client)
          // Note that because we sign with SIGHASH_NONE|SIGHASH_ANYOENCANPAY the client can later add more outputs and
          // inputs, but we will need only one output later to create the paying transactions
          if (refundTx.getOutputs().size() != 1)
              throw new VerificationException("Refund transaction does not have exactly one output");
  
          refundTransactionUnlockTimeSecs = refundTx.getLockTime();
  
          // Sign the refund tx with the scriptPubKey and return the signature. We don't have the spending transaction
          // so do the steps individually.
          clientKey = ECKey.fromPublicOnly(clientMultiSigPubKey);
          Script multisigPubKey = ScriptBuilder.createMultiSigOutputScript(2, ImmutableList.of(clientKey, serverKey));
          // We are really only signing the fact that the transaction has a proper lock time and don't care about anything
          // else, so we sign SIGHASH_NONE and SIGHASH_ANYONECANPAY.
          TransactionSignature sig = refundTx.calculateSignature(0, serverKey, multisigPubKey, Transaction.SigHash.NONE, true);
          log.info("Signed refund transaction.");
          this.clientOutput = refundTx.getOutput(0);
          stateMachine.transition(State.WAITING_FOR_MULTISIG_CONTRACT);
          return sig.encodeToBitcoin();
      }