If anyone is suffering from a lot of small coin amounts, like when getting them from p2p pools mining and getting "Transaction too large" when trying to send coins, I finally found the answer. From source code:
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000;
/** The maximum size for mined blocks */
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
/** The maximum size for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_SIZE = MAX_BLOCK_SIZE_GEN/5;
// BitQuark: Added safety margin 4000 bytes and 160 transactions
if ((nBytes + 4000 >= MAX_STANDARD_TX_SIZE) || (wtxNew.vin.size() >= 160))
{
strFailReason = _("Transaction too large");
return false;
}
So, transaction size limit is 100000 bytes or 159 inputs from coin control, whichever comes first.
I verified, it works with 159 inputs, but not with 160 and 161.
Just an FYI to noobs or non-technical people, because that's what I am, if you P2P pool, every day or so consolidate your transactions in coin control. Send them to yourself at a different wallet address.
When you have like 40,000 dust transactions, the wallet becomes slow as hell. Sometimes it's better to just empty your wallet into another one.