mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(hydrateUtxos): Allow users to pass in utxoDelay
This commit is contained in:
Generated
+765
-19870
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -29,7 +29,7 @@
|
||||
"node": ">=10.15.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@psf/bch-js": "^4.15.19",
|
||||
"@psf/bch-js": "^4.15.21",
|
||||
"apidoc": "^0.26.0",
|
||||
"axios": "^0.21.1",
|
||||
"bitcore-lib-cash": "^8.23.1",
|
||||
|
||||
@@ -1979,6 +1979,11 @@ class Slp {
|
||||
try {
|
||||
const utxos = req.body.utxos
|
||||
|
||||
// Extract a delay value if the user passed it in.
|
||||
const usrObjIn = req.body.usrObj
|
||||
let utxoDelay = 0
|
||||
if (usrObjIn && usrObjIn.utxoDelay) { utxoDelay = usrObjIn.utxoDelay }
|
||||
|
||||
// console.log('req: ', req)
|
||||
// console.log(`req._remoteAddress: ${req._remoteAddress}`)
|
||||
|
||||
@@ -1988,7 +1993,8 @@ class Slp {
|
||||
ip: req._remoteAddress,
|
||||
jwtToken: req.locals.jwtToken,
|
||||
proLimit: req.locals.proLimit,
|
||||
apiLevel: req.locals.apiLevel
|
||||
apiLevel: req.locals.apiLevel,
|
||||
utxoDelay
|
||||
}
|
||||
|
||||
// Validate inputs
|
||||
@@ -2049,7 +2055,8 @@ class Slp {
|
||||
|
||||
res.status(500)
|
||||
return res.json({
|
||||
error: 'Error in hydrateUtxos()'
|
||||
error: 'Undetermined error in hydrateUtxos()',
|
||||
message: err.message
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user