refactor: Use uint64_t over size_t for serialized-size values

The values are small enough to fit in size_t, but to avoid having to
think about it, just use uint64_t consistently for all architectures.

On 64-bit systems, this refactor is a no-op. On 32-bit systems, it could
avoid bugs in the theoretical and unexpected case where a 32-bit size_t
is too small and overflows.
This commit is contained in:
MarcoFalke committed 2025-10-30 17:51:40 +01:00
1 parent fa4f388fc9
commit fad0c8680e
9 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -1034,7 +1034,7 @@ void DiscourageFeeSniping(CMutableTransaction& tx, FastRandomContext& rng_fast,
}
}
size_t GetSerializeSizeForRecipient(const CRecipient& recipient)
uint64_t GetSerializeSizeForRecipient(const CRecipient& recipient)
{
return ::GetSerializeSize(CTxOut(recipient.nAmount, GetScriptForDestination(recipient.dest)));
}