Currently, the multisig descriptor constructions are limited to 16 keys only possibly because of template parsing reasons. Under p2sh context, such scripts would be invalid anyway because of 520-byte rule, but we can support up to 20 keys for CHECKMULTISIG in witness script context. 


{
private:
    const T& txTo;             
    const CScript& scriptCode; 
    const unsigned int nIn;    
    const bool fAnyoneCanPay;  
    const bool fHashSingle;    
    const bool fHashNone;      
public:
    CTransactionSignatureSerializer(const T& txToIn, const CScript& scriptCodeIn, unsigned int nInIn, int nHashTypeIn) :