diff --git a/rai/node/common.cpp b/rai/node/common.cpp index 6a946313..65770d83 100644 --- a/rai/node/common.cpp +++ b/rai/node/common.cpp @@ -363,7 +363,7 @@ bool rai::confirm_req::operator == (rai::confirm_req const & other_a) const rai::confirm_ack::confirm_ack (bool & error_a, rai::stream & stream_a) : message (error_a, stream_a), -vote (std::make_shared (error_a, stream_a)) +vote (std::make_shared (error_a, stream_a, block_type ())) { } @@ -403,7 +403,7 @@ void rai::confirm_ack::serialize (rai::stream & stream_a) { assert (block_type () == rai::block_type::send || block_type () == rai::block_type::receive || block_type () == rai::block_type::open || block_type () == rai::block_type::change); write_header (stream_a); - vote->serialize (stream_a); + vote->serialize (stream_a, block_type ()); } bool rai::confirm_ack::operator == (rai::confirm_ack const & other_a) const diff --git a/rai/secure.cpp b/rai/secure.cpp index 4fc6b589..5bcdff2e 100755 --- a/rai/secure.cpp +++ b/rai/secure.cpp @@ -3654,6 +3654,14 @@ rai::uint256_union rai::vote::hash () const return result; } +void rai::vote::serialize (rai::stream & stream_a, rai::block_type) +{ + write (stream_a, account); + write (stream_a, signature); + write (stream_a, sequence); + block->serialize (stream_a); +} + void rai::vote::serialize (rai::stream & stream_a) { write (stream_a, account); diff --git a/rai/secure.hpp b/rai/secure.hpp index cff35980..cafad76d 100644 --- a/rai/secure.hpp +++ b/rai/secure.hpp @@ -338,6 +338,7 @@ public: rai::uint256_union hash () const; bool operator == (rai::vote const &) const; bool operator != (rai::vote const &) const; + void serialize (rai::stream &, rai::block_type); void serialize (rai::stream &); std::string to_json () const; // Vote round sequence number