make sure stackedMsats is updated for forwardees

This commit is contained in:
keyan 2024-07-08 09:35:29 -05:00
parent 02472bb81f
commit 0312012089
1 changed files with 3 additions and 1 deletions

View File

@ -79,7 +79,9 @@ export async function onPaid ({ invoice, actIds }, { models, tx }) {
FROM forwardees
), forward AS (
UPDATE users
SET msats = users.msats + forwardees.msats
SET
msats = users.msats + forwardees.msats,
"stackedMsats" = users."stackedMsats" + forwardees.msats
FROM forwardees
WHERE users.id = forwardees."userId"
)