Skip to content

Commit

Permalink
Merge #12737: Remove unnecessary NONNEGATIVE_SIGNED
Browse files Browse the repository at this point in the history
34ca750 Remove unnecessary NONNEGATIVE_SIGNED (Russell Yanofsky)

Pull request description:

  Switch to unsigned encoding, which is backwards compatible and avoids MSVC
  error reported #12732

Tree-SHA512: 9687842aa8cb745ba7cf7612bd2feea0cef14953aba9af26c72c6eb3c974d790152eb4d0e8654d4ae451fe80947cb2552a82f19b1f9e9658701aed8ce0ee5c23
  • Loading branch information
sipa committed Mar 21, 2018
2 parents 4ba3d4f + 34ca750 commit 9b8b107
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash,
{
assert(!outputs.empty());
ss << hash;
ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase, VarIntMode::NONNEGATIVE_SIGNED);
ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase ? 1u : 0u);
stats.nTransactions++;
for (const auto output : outputs) {
ss << VARINT(output.first + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TxInUndoSerializer
public:
template<typename Stream>
void Serialize(Stream &s) const {
::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1 : 0), VarIntMode::NONNEGATIVE_SIGNED));
::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1u : 0u)));
if (txout->nHeight > 0) {
// Required to maintain compatibility with older undo format.
::Serialize(s, (unsigned char)0);
Expand Down

0 comments on commit 9b8b107

Please sign in to comment.