…ature combining
Currently the wallet can only sign/understand up to n-of-16 checkmultisig templates. Some efforts are being taken to expand this to n-of-20: #13348 . Rather than try to increase the number of possible signatures marginally this template is based on https://bitcoin.stackexchange.com/a/51653 which allows signing/combining of up to n-of-67, constrained by the non-push opcode limit.
0+/* Script of the form:
1+ *
2+ * <pubkey1> OP_CHECKSIG
3+ * OP_SWAP <pubkey2> OP_CHECKSIG OP_ADD
4+ * OP_SWAP <pubkey3> OP_CHECKSIG OP_ADD
5+ * ...
6+ * OP_SWAP <pubkey67> OP_CHECKSIG OP_ADD
7+ * <m> OP_NUMEQUAL
8+ */
Wallet code currently disallows import of any redeem/witnessscript beyond 520 bytes(n-of-15), so no safety is lost due to the possible mixture of segwit/non-segwit scripts.
Looking for concept ACKs before I go write tests and attempt code de-duplication, but manual testing worked.