Transaction floData length limits

This commit is contained in:
Jeremiah Buddenhagen 2018-02-23 15:28:37 -08:00
parent 17af763417
commit aeb784e398

View File

@ -461,6 +461,16 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
return state.DoS(0, false, REJECT_NONSTANDARD, "no-witness-yet", true);
}
if (tx.nVersion >= 2) {
int maxCommentLen = 528;
if (witnessEnabled) {
maxCommentLen = 1040;
}
if (tx.strFloData.length() > maxCommentLen) {
return state.DoS(0, false, REJECT_INVALID, "flo-data-too-large");
}
}
// Rather not work on nonstandard transactions (unless -testnet/-regtest)
std::string reason;
if (fRequireStandard && !IsStandardTx(tx, reason, witnessEnabled))