Function sentry::db::accounting::spend_amount
source · pub async fn spend_amount(
pool: DbPool,
channel_id: ChannelId,
delta_balances: Balances<CheckedState>
) -> Result<(Vec<Accounting>, Vec<Accounting>), PoolError>
Expand description
delta_balances
defines the Balances that need to be added to the spending or earnings of the Accounting
s.
It will not override the whole Accounting
value
Returns a tuple of (Vec<Earners Accounting>, Vec<Spenders Accounting>)
Error
It will return an error if any of the updates fails but it would have updated the rest of them.
This way we ensure that even if a single or multiple Accounting updates fail, we will still pay out the rest of them.