pub fn add_output(
amount: Amount,
output: &Output,
tables: &mut impl TablesMut,
) -> DbResult<PreRctOutputId>Expand description
Add a Pre-RCT Output to the database.
Upon Ok, this function returns the PreRctOutputId that
can be used to lookup the Output in get_output().
§⚠️ Invariant ⚠️
This function mainly exists to be used internally by the parent function crate::ops::block::add_block.
add_block() makes sure all data related to the input is mutated, while
this function does not, it specifically mutates particular tables.
This is usually undesired - although this function is still available to call directly.
When calling this function, ensure that either:
- This effect (incomplete database mutation) is what is desired, or that…
- …the other tables will also be mutated to a correct state
§Errors
This function returns cuprate_database::RuntimeError::KeyNotFound if the input (if applicable) doesn’t exist or other RuntimeError’s on database errors.