diff options
Diffstat (limited to 'src/compressor.h')
-rw-r--r-- | src/compressor.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compressor.h b/src/compressor.h index 7bb60d311e..223603e7e9 100644 --- a/src/compressor.h +++ b/src/compressor.h @@ -15,7 +15,17 @@ bool CompressScript(const CScript& script, std::vector<unsigned char> &out); unsigned int GetSpecialScriptSize(unsigned int nSize); bool DecompressScript(CScript& script, unsigned int nSize, const std::vector<unsigned char> &out); +/** + * Compress amount. + * + * nAmount is of type uint64_t and thus cannot be negative. If you're passing in + * a CAmount (int64_t), make sure to properly handle the case where the amount + * is negative before calling CompressAmount(...). + * + * @pre Function defined only for 0 <= nAmount <= MAX_MONEY. + */ uint64_t CompressAmount(uint64_t nAmount); + uint64_t DecompressAmount(uint64_t nAmount); /** Compact serializer for scripts. |