Module transaction_utils

Source
Expand description

Transaction utilities

Constants§

MAX_VALUE_MSAT
The maximum value of an input or output in milli satoshi
MIN_CHAN_DUST_LIMIT_SATOSHIS
The minimum value of the dust limit in satoshis - for segwit in general This is also the minimum negotiated dust limit
MIN_DUST_LIMIT_SATOSHIS
The minimum value of the dust limit in satoshis - for p2wsh outputs (such as anchors)

Functions§

create_spending_transaction
Create a spending transaction, helper function used in [KeysManagerClient::spend_spendable_outputs].
decode_commitment_number
Decode a commitment transaction and return the commitment number if it is a commitment tx
decode_commitment_tx
Decode a commitment transaction and return the outputs that we need to watch. Our main output index and any HTLC output indexes are returned.
maybe_add_change_output
Possibly adds a change output to the given transaction, always doing so if there are excess funds available beyond the requested feerate. Assumes at least one input will have a witness (ie spends a segwit output). Returns an Err(()) if the requested feerate cannot be met.