Skip to content

Commit

Permalink
Thread-safe updating of tip object.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbobeirne committed May 10, 2019
1 parent 5e069d2 commit e579ae9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/boltathon/util/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def watch_and_update_tip_invoice(app, tip, invoice):
# If it's our invoice that's been paid, mark it as such and break out
if inv.r_hash.hex() == invoice.r_hash.hex() and hasattr(inv, 'amt_paid_sat') and inv.amt_paid_sat:
with app.app_context():
tip.confirm(inv.amt_paid_sat)
local_tip = db.session.merge(tip)
local_tip.confirm(inv.amt_paid_sat)
db.session.commit()
break

Expand Down

0 comments on commit e579ae9

Please sign in to comment.