aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2018-03-20 19:15:29 -0700
committerPieter Wuille <[email protected]>2018-03-20 19:21:10 -0700
commit9b8b1079ddab64ac955766536c38d23dc57bc499 (patch)
treee53afcde44338b3b5df92c900d34c5068e269992
parentMerge #12728: [tests] rename TestNode to TestP2PConn in tests (diff)
parentRemove unnecessary NONNEGATIVE_SIGNED (diff)
downloaddiscoin-9b8b1079ddab64ac955766536c38d23dc57bc499.tar.xz
discoin-9b8b1079ddab64ac955766536c38d23dc57bc499.zip
Merge #12737: Remove unnecessary NONNEGATIVE_SIGNED
34ca750320 Remove unnecessary NONNEGATIVE_SIGNED (Russell Yanofsky) Pull request description: Switch to unsigned encoding, which is backwards compatible and avoids MSVC error reported https://github.com/bitcoin/bitcoin/issues/12732 Tree-SHA512: 9687842aa8cb745ba7cf7612bd2feea0cef14953aba9af26c72c6eb3c974d790152eb4d0e8654d4ae451fe80947cb2552a82f19b1f9e9658701aed8ce0ee5c23
-rw-r--r--src/rpc/blockchain.cpp2
-rw-r--r--src/undo.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 3f66c0c53..169caddc5 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -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);
diff --git a/src/undo.h b/src/undo.h
index 6fc25b985..9f39299fb 100644
--- a/src/undo.h
+++ b/src/undo.h
@@ -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);