Renaming nano::vote::deserialize result' to error' to match the semantics of what's being returned and added documentation to function.

This commit is contained in:
clemahieu 2022-05-09 15:17:45 +01:00
commit b5099ff0de
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
2 changed files with 7 additions and 3 deletions

View file

@ -591,7 +591,7 @@ void nano::vote::serialize (nano::stream & stream_a) const
bool nano::vote::deserialize (nano::stream & stream_a)
{
auto result = false;
auto error = false;
try
{
nano::read (stream_a, account.bytes);
@ -607,9 +607,9 @@ bool nano::vote::deserialize (nano::stream & stream_a)
}
catch (std::runtime_error const &)
{
result = true;
error = true;
}
return result;
return error;
}
bool nano::vote::validate () const

View file

@ -267,6 +267,10 @@ public:
bool operator!= (nano::vote const &) const;
void serialize (nano::stream &) const;
void serialize_json (boost::property_tree::ptree & tree) const;
/**
* Deserializes a vote from the bytes in `stream'
* Returns true if there was an error
*/
bool deserialize (nano::stream &);
bool validate () const;
boost::transform_iterator<nano::iterate_vote_blocks_as_hash, nano::vote_blocks_vec_iter> begin () const;