Pulse: Check block has pulse components before seeding entropy

This commit is contained in:
Doyle 2020-09-04 13:51:20 +10:00 committed by Jason Rhinelander
parent 8391ebe961
commit b359697e21

View file

@ -1649,7 +1649,8 @@ namespace service_nodes
for (cryptonote::block const &block : blocks)
{
crypto::hash hash = {};
if (block.major_version >= cryptonote::network_version_16)
if (block.major_version >= cryptonote::network_version_16 &&
cryptonote::block_has_pulse_components(block))
{
std::array<uint8_t, 1 + sizeof(block.pulse.random_value)> src = {pulse_round};
std::copy(std::begin(block.pulse.random_value.data), std::end(block.pulse.random_value.data), src.begin() + 1);