Module scid_utils
Expand description
Utilities for creating and parsing short channel ids.
Enums§
- Short
Channel IdError - A
short_channel_id
construction error
Constants§
- MAX_
SCID_ BLOCK - Maximum block height that can be used in a
short_channel_id
. This value is based on the 3-bytes available for block height. - MAX_
SCID_ TX_ INDEX - Maximum transaction index that can be used in a
short_channel_id
. This value is based on the 3-bytes available for tx index. - MAX_
SCID_ VOUT_ INDEX - Maximum vout index that can be used in a
short_channel_id
. This value is based on the 2-bytes available for the vout index.
Functions§
- block_
from_ scid - Extracts the block height (most significant 3-bytes) from the
short_channel_id
- scid_
from_ parts - Constructs a
short_channel_id
using the components pieces. Results in an error if the block height, tx index, or vout index overflow the maximum sizes. - tx_
index_ from_ scid - Extracts the tx index (bytes [2..4]) from the
short_channel_id
- vout_
from_ scid - Extracts the vout (bytes [0..2]) from the
short_channel_id