package org.bitcoinj.quorums;

import org.bitcoinj.core.Sha256Hash;
import org.bitcoinj.core.UnsafeByteArrayOutputStream;
import org.bitcoinj.core.Utils;
import org.bitcoinj.crypto.BLSPublicKey;

import java.io.IOException;
import java.util.ArrayList;

public class LLMQUtils {
    static public Sha256Hash buildCommitmentHash(LLMQParameters.LLMQType llmqType, Sha256Hash blockHash, ArrayList<Boolean> validMembers, BLSPublicKey pubKey, Sha256Hash vvecHash)
    {
        try {
            UnsafeByteArrayOutputStream bos = new UnsafeByteArrayOutputStream();
            bos.write(llmqType.getValue());
            bos.write(blockHash.getReversedBytes());
            Utils.booleanArrayListToStream(validMembers, bos);
            pubKey.bitcoinSerialize(bos);
            bos.write(vvecHash.getReversedBytes());
            return Sha256Hash.wrap(Sha256Hash.hashTwice(bos.toByteArray()));
        } catch (IOException x) {
            throw new RuntimeException(x);
        }
    }
}

@@ -976,10 +976,798 @@
 %7D%0A    %7D%0A
+%0A%0A    static public Sha256Hash buildSignHash(int llmqType, Sha256Hash quorumHash, Sha256Hash id, Sha256Hash msgHash)%0A    %7B%0A        try %7B%0A            UnsafeByteArrayOutputStream bos = new UnsafeByteArrayOutputStream();%0A            bos.write(llmqType);%0A            bos.write(quorumHash.getReversedBytes());%0A            bos.write(id.getBytes());%0A            bos.write(msgHash.getReversedBytes());%0A            return Sha256Hash.wrap(Sha256Hash.hashTwice(bos.toByteArray()));%0A        %7D catch (IOException x) %7B%0A            throw new RuntimeException(x);%0A        %7D%0A    %7D%0A%0A    static public Sha256Hash buildSignHash(LLMQParameters.LLMQType llmqType, Sha256Hash quorumHash, Sha256Hash id, Sha256Hash msgHash)%0A    %7B%0A        return buildSignHash(llmqType.getValue(), quorumHash, id, msgHash);%0A    %7D%0A
 %7D%0A

Add buildSignHash method