aboutsummaryrefslogtreecommitdiff
path: root/src/coins.h
diff options
context:
space:
mode:
authorpierrenn <git@pnn.sh>2020-03-26 07:48:48 +0900
committerpierrenn <git@pnn.sh>2020-03-28 08:38:07 +0900
commite980214bc4fd49530e8d50fe0a6657b8583bc6b5 (patch)
tree75d1988a8bc31563704fd8dba936a175624a0eae /src/coins.h
parent97b0687501cee77a9170f9e288755a5d268e9bd4 (diff)
serialization: prevent int overflow for big Coin::nHeight
Diffstat (limited to 'src/coins.h')
-rw-r--r--src/coins.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coins.h b/src/coins.h
index e71c8a47bc..ea2e759b54 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -59,7 +59,7 @@ public:
template<typename Stream>
void Serialize(Stream &s) const {
assert(!IsSpent());
- uint32_t code = nHeight * 2 + fCoinBase;
+ uint32_t code = nHeight * uint32_t{2} + fCoinBase;
::Serialize(s, VARINT(code));
::Serialize(s, Using<TxOutCompression>(out));
}