Skip to content

Commit 9b8b107

Browse files
committed
Merge #12737: Remove unnecessary NONNEGATIVE_SIGNED
34ca750 Remove unnecessary NONNEGATIVE_SIGNED (Russell Yanofsky) Pull request description: Switch to unsigned encoding, which is backwards compatible and avoids MSVC error reported bitcoin/bitcoin#12732 Tree-SHA512: 9687842aa8cb745ba7cf7612bd2feea0cef14953aba9af26c72c6eb3c974d790152eb4d0e8654d4ae451fe80947cb2552a82f19b1f9e9658701aed8ce0ee5c23
2 parents 4ba3d4f + 34ca750 commit 9b8b107

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash,
834834
{
835835
assert(!outputs.empty());
836836
ss << hash;
837-
ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase, VarIntMode::NONNEGATIVE_SIGNED);
837+
ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase ? 1u : 0u);
838838
stats.nTransactions++;
839839
for (const auto output : outputs) {
840840
ss << VARINT(output.first + 1);

src/undo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TxInUndoSerializer
2525
public:
2626
template<typename Stream>
2727
void Serialize(Stream &s) const {
28-
::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1 : 0), VarIntMode::NONNEGATIVE_SIGNED));
28+
::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1u : 0u)));
2929
if (txout->nHeight > 0) {
3030
// Required to maintain compatibility with older undo format.
3131
::Serialize(s, (unsigned char)0);

0 commit comments

Comments
 (0)