|
|
@ -166,6 +166,9 @@ unsigned RLP::length() const |
|
|
|
{ |
|
|
|
if ((int)m_data.size() <= n - c_rlpDataIndLenZero) |
|
|
|
BOOST_THROW_EXCEPTION(BadRLP()); |
|
|
|
if ((int)m_data.size() > 1) |
|
|
|
if (m_data[1] == 0) |
|
|
|
BOOST_THROW_EXCEPTION(BadRLP()); |
|
|
|
for (int i = 0; i < n - c_rlpDataIndLenZero; ++i) |
|
|
|
ret = (ret << 8) | m_data[i + 1]; |
|
|
|
} |
|
|
@ -175,6 +178,9 @@ unsigned RLP::length() const |
|
|
|
{ |
|
|
|
if ((int)m_data.size() <= n - c_rlpListIndLenZero) |
|
|
|
BOOST_THROW_EXCEPTION(BadRLP()); |
|
|
|
if ((int)m_data.size() > 1) |
|
|
|
if (m_data[1] == 0) |
|
|
|
BOOST_THROW_EXCEPTION(BadRLP()); |
|
|
|
for (int i = 0; i < n - c_rlpListIndLenZero; ++i) |
|
|
|
ret = (ret << 8) | m_data[i + 1]; |
|
|
|
} |
|
|
|