CompressAmount

Compress amount.

Synopsis

Declared in <compressor.h>

uint64_t
CompressAmount(uint64_t nAmount);

Description

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(...).

Return Value

The compressed amount encoding.

Parameters

NameDescription
nAmountThe amount in satoshis to compress.

Preconditions

  • Function defined only for 0 <= nAmount <= MAX_MONEY.