mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-05 16:57:53 +00:00
allow nops to be specified in emitted txns
This commit is contained in:
@@ -58,11 +58,24 @@ STArray::STArray(std::vector<STObject> const& v, SField const& f) : STBase(f)
|
||||
|
||||
STArray::STArray(SerialIter& sit, SField const& f, int depth) : STBase(f)
|
||||
{
|
||||
uint8_t nop_counter = 0;
|
||||
while (!sit.empty())
|
||||
{
|
||||
int type, field;
|
||||
sit.getFieldID(type, field);
|
||||
|
||||
// pass nops
|
||||
if (type == 9 && field == 9)
|
||||
{
|
||||
if (++nop_counter == 64)
|
||||
{
|
||||
JLOG(debugLog().error())
|
||||
<< "Too many NOPS";
|
||||
Throw<std::runtime_error>("Too many NOPS");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((type == STI_ARRAY) && (field == 1))
|
||||
break;
|
||||
|
||||
|
||||
@@ -183,6 +183,8 @@ STObject::set(SerialIter& sit, int depth)
|
||||
|
||||
v_.clear();
|
||||
|
||||
uint8_t nop_counter = 0;
|
||||
|
||||
// Consume data in the pipe until we run out or reach the end
|
||||
while (!sit.empty())
|
||||
{
|
||||
@@ -192,6 +194,18 @@ STObject::set(SerialIter& sit, int depth)
|
||||
// Get the metadata for the next field
|
||||
sit.getFieldID(type, field);
|
||||
|
||||
// pass nops
|
||||
if (type == 9 && field == 9)
|
||||
{
|
||||
if (++nop_counter == 64)
|
||||
{
|
||||
JLOG(debugLog().error())
|
||||
<< "Too many NOPS";
|
||||
Throw<std::runtime_error>("Too many NOPS");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// The object termination marker has been found and the termination
|
||||
// marker has been consumed. Done deserializing.
|
||||
if (type == STI_OBJECT && field == 1)
|
||||
|
||||
Reference in New Issue
Block a user