mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Remove unnecessary NONNEGATIVE_SIGNED
Switch to unsigned encoding, which is backwards compatible and avoids MSVC error reported https://github.com/bitcoin/bitcoin/issues/12732
This commit is contained in:
parent
4ba3d4f439
commit
34ca750320
@ -834,7 +834,7 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash,
|
|||||||
{
|
{
|
||||||
assert(!outputs.empty());
|
assert(!outputs.empty());
|
||||||
ss << hash;
|
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++;
|
stats.nTransactions++;
|
||||||
for (const auto output : outputs) {
|
for (const auto output : outputs) {
|
||||||
ss << VARINT(output.first + 1);
|
ss << VARINT(output.first + 1);
|
||||||
|
@ -25,7 +25,7 @@ class TxInUndoSerializer
|
|||||||
public:
|
public:
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
void Serialize(Stream &s) const {
|
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) {
|
if (txout->nHeight > 0) {
|
||||||
// Required to maintain compatibility with older undo format.
|
// Required to maintain compatibility with older undo format.
|
||||||
::Serialize(s, (unsigned char)0);
|
::Serialize(s, (unsigned char)0);
|
||||||
|
Loading…
Reference in New Issue
Block a user