Improve pseudo-transaction handling (RIPD-1454, RIPD-1455):

Adds additional checks to prevent relaying and retrying pseudo-transactions.
This commit is contained in:
Brad Chase
2017-04-11 17:05:10 -04:00
committed by Nik Bougalis
parent 8002a13dd2
commit f2787dc35c
9 changed files with 210 additions and 53 deletions

View File

@@ -504,6 +504,11 @@ bool passesLocalChecks (STObject const& st, std::string& reason)
return false;
}
if (isPseudoTx(st))
{
reason = "Cannot submit pseudo transactions.";
return false;
}
return true;
}
@@ -516,4 +521,14 @@ sterilize (STTx const& stx)
return std::make_shared<STTx const>(std::ref(sit));
}
bool
isPseudoTx(STObject const& tx)
{
auto t = tx[~sfTransactionType];
if (!t)
return false;
auto tt = static_cast<TxType>(*t);
return tt == ttAMENDMENT || tt == ttFEE;
}
} // ripple