mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
serialization: prevent int overflow for big Coin::nHeight
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user