fix changing only building script overrides, not message or script

This commit is contained in:
Crypto City 2021-10-25 10:19:26 +00:00
parent 57652e5635
commit 8eeb012972
2 changed files with 4 additions and 2 deletions

View File

@ -76,8 +76,8 @@ bool cc_command_handler_carve_runestone::check(const cryptonote::BlockchainDB &d
CHECK_COMMAND_SET(fd.role != ROLE_EMPTY, tvc.m_cc_bad_role, "Cannot carve a runestone on an empty flag");
CHECK_COMMAND_SET(fd.fire_state == 0 || fd.fire_state >= 128, tvc.m_cc_on_fire, "Cannot carve a runestone on a building that's on fire");
CHECK_COMMAND_SET(carve_runestone.previous_message != carve_runestone.message || carve_runestone.script_delta != 0, tvc.m_cc_invalid_previous_state,
"carve_runestone command changes neither the message nor script");
CHECK_COMMAND_SET(carve_runestone.previous_message != carve_runestone.message || carve_runestone.script_delta != 0 || carve_runestone.previous_overrides != carve_runestone.overrides, tvc.m_cc_invalid_previous_state,
"carve_runestone command changes neither the message nor script nor overrides");
cc::runestone_t runestone;
std::string message;

View File

@ -1047,6 +1047,8 @@ namespace cryptonote
uint32_t idx;
std::string text;
bool operator==(const override_t &other) const { return type == other.type && idx == other.idx && text == other.text; }
BEGIN_SERIALIZE_OBJECT()
FIELD(type)
VARINT_FIELD(idx)