Bitcoin Core 28.99.0
P2P Digital Currency
Functions
compressor.cpp File Reference
#include <compressor.h>
#include <pubkey.h>
#include <script/script.h>
Include dependency graph for compressor.cpp:

Go to the source code of this file.

Functions

static bool IsToKeyID (const CScript &script, CKeyID &hash)
 
static bool IsToScriptID (const CScript &script, CScriptID &hash)
 
static bool IsToPubKey (const CScript &script, CPubKey &pubkey)
 
bool CompressScript (const CScript &script, CompressedScript &out)
 
unsigned int GetSpecialScriptSize (unsigned int nSize)
 
bool DecompressScript (CScript &script, unsigned int nSize, const CompressedScript &in)
 
uint64_t CompressAmount (uint64_t n)
 Compress amount. More...
 
uint64_t DecompressAmount (uint64_t x)
 

Function Documentation

◆ CompressAmount()

uint64_t CompressAmount ( uint64_t  nAmount)

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

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

Definition at line 149 of file compressor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompressScript()

bool CompressScript ( const CScript script,
CompressedScript out 
)

Definition at line 55 of file compressor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecompressAmount()

uint64_t DecompressAmount ( uint64_t  x)

Definition at line 168 of file compressor.cpp.

Here is the caller graph for this function:

◆ DecompressScript()

bool DecompressScript ( CScript script,
unsigned int  nSize,
const CompressedScript in 
)

Definition at line 95 of file compressor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSpecialScriptSize()

unsigned int GetSpecialScriptSize ( unsigned int  nSize)

Definition at line 86 of file compressor.cpp.

Here is the caller graph for this function:

◆ IsToKeyID()

static bool IsToKeyID ( const CScript script,
CKeyID hash 
)
static

Definition at line 19 of file compressor.cpp.

Here is the caller graph for this function:

◆ IsToPubKey()

static bool IsToPubKey ( const CScript script,
CPubKey pubkey 
)
static

Definition at line 40 of file compressor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsToScriptID()

static bool IsToScriptID ( const CScript script,
CScriptID hash 
)
static

Definition at line 30 of file compressor.cpp.

Here is the caller graph for this function: