mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(electrumx): Allowing POST balance to circumvent cache
This commit is contained in:
@@ -199,9 +199,16 @@ class Electrum {
|
|||||||
|
|
||||||
console.log('req.locals: ', req.locals)
|
console.log('req.locals: ', req.locals)
|
||||||
|
|
||||||
|
// Use the cache for anonymous users. If the user has a valid JWT token
|
||||||
|
// or is using Basic Authentiation, then do not use the cache.
|
||||||
|
let useCache = true
|
||||||
|
if (req.locals.proLimit || req.locals.apiLevel > 10) {
|
||||||
|
useCache = false
|
||||||
|
}
|
||||||
|
|
||||||
const response = await _this.axios.post(
|
const response = await _this.axios.post(
|
||||||
`${_this.fulcrumApi}electrumx/balance/`,
|
`${_this.fulcrumApi}electrumx/balance/`,
|
||||||
{ addresses }
|
{ addresses, useCache }
|
||||||
)
|
)
|
||||||
|
|
||||||
res.status(200)
|
res.status(200)
|
||||||
|
|||||||
Reference in New Issue
Block a user