Skip to content

Commit

Permalink
util: Correctly serialize messages with only nVersion
Browse files Browse the repository at this point in the history
It should solve the bug described in peercoin/peercoin#708
  • Loading branch information
lateminer committed Oct 29, 2023
1 parent dc69279 commit e7ebbbe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,13 @@ inline void WriteCompactSize(CSizeComputer &s, uint64_t nSize)
}

template <typename T>
size_t GetSerializeSize(const T& t, int nType, int nVersion = 0)
size_t GetSerializeSize(const T& t, int nVersion)
{
return (CSizeComputer(0, nVersion) << t).size();
}

template <typename T>
size_t GetSerializeSize(const T& t, int nType, int nVersion)
{
return (CSizeComputer(nType, nVersion) << t).size();
}
Expand Down

0 comments on commit e7ebbbe

Please sign in to comment.