Skip to content

Commit

Permalink
Fix register
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Nov 1, 2023
1 parent 0a1bdf2 commit 173fdff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions db/reg_pollers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function upsert_reg_poller(amount, sym, uid, init_bal)
if #rps ~= 0 then
local rp = rps[1]
rp = wrap_rp(rp)
print(pr['uid'])
print(uid)
if rp['uid'] ~= uid then
return { err = 'Someone already waits for such transfer.', res = nil }
end
Expand Down
3 changes: 2 additions & 1 deletion src/pages/api/reg/[...all].js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ let handler = nextConnect({ attachParams: true, })
try {
initBal = await getBalance()
} catch (err) {
console.error('wait_for_transfer getBalance', initBal)
throwErr(req, 400, ['Blockchain unavailable'])
}

Expand Down Expand Up @@ -438,7 +439,7 @@ let handler = nextConnect({ attachParams: true, })
}

console.log('wait_for_transfer', initBal.toString(), bal.toString())
const delta = bal.amount.minus(initBal.amount)
const delta = bal.minus(initBal.amount)
if (delta.gte(amount)) {
let stopMe = false

Expand Down

0 comments on commit 173fdff

Please sign in to comment.