diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -983,7 +983,9 @@ assert(!outputs.empty()); ss << hash; ss << VARINT(outputs.begin()->second.GetHeight() * 2 + - outputs.begin()->second.IsCoinBase()); + outputs.begin()->second.IsCoinBase() + ? 1u + : 0u); stats.nTransactions++; for (const auto &output : outputs) { ss << VARINT(output.first + 1); diff --git a/src/undo.h b/src/undo.h --- a/src/undo.h +++ b/src/undo.h @@ -33,8 +33,8 @@ explicit TxInUndoSerializer(const Coin *pcoinIn) : pcoin(pcoinIn) {} template void Serialize(Stream &s) const { - ::Serialize( - s, VARINT(pcoin->GetHeight() * 2 + (pcoin->IsCoinBase() ? 1 : 0))); + ::Serialize(s, VARINT(pcoin->GetHeight() * 2 + + (pcoin->IsCoinBase() ? 1u : 0u))); if (pcoin->GetHeight() > 0) { // Required to maintain compatibility with older undo format. ::Serialize(s, uint8_t(0));