fix mutex (#192)

This commit is contained in:
gohumble 2021-12-23 17:18:04 +01:00 committed by GitHub
parent 1b24072020
commit 657fc7af1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,8 +203,6 @@ func (bot *TipBot) acceptInlineReceiveHandler(ctx context.Context, c *tb.Callbac
func (bot *TipBot) sendInlineReceiveHandler(ctx context.Context, c *tb.Callback) {
tx := &InlineReceive{Base: storage.New(storage.ID(c.Data))}
mutex.Lock(tx.ID)
defer mutex.Unlock(tx.ID)
rn, err := tx.Get(tx, bot.Bunt)
// immediatelly set intransaction to block duplicate calls
if err != nil {
@ -302,8 +300,6 @@ func (bot *TipBot) inlineReceiveEvent(invoiceEvent *InvoiceEvent) {
func (bot *TipBot) finishInlineReceiveHandler(ctx context.Context, c *tb.Callback) {
tx := &InlineReceive{Base: storage.New(storage.ID(c.Data))}
mutex.Lock(tx.ID)
defer mutex.Unlock(tx.ID)
// immediatelly set intransaction to block duplicate calls
rn, err := tx.Get(tx, bot.Bunt)
if err != nil {