In multisignature address contract, how to set multisigoutput while sending bitcoin back to the client?
I tried this,
byte[] bytes = Utils.HEX.decode("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
spendTx.addInput(new TransactionInput(params, spendTx, bytes));
ByteArrayOutputStream scriptPubKeyBytes = new ByteArrayOutputStream();
Script.writeBytes(scriptPubKeyBytes, Utils.HEX.decode("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
scriptPubKeyBytes.write(ScriptOpCodes.OP_CHECKSIG);
spendTx.addOutput(new TransactionOutput(params, spendTx, value, scriptPubKeyBytes.toByteArray()));
spendTx.addOutput(value, clientKey);
TransactionOutput multisigOutput = spendTx.getOutput(0);