fix(hydrateUtxos): Allow users to pass in utxoDelay

This commit is contained in:
Chris Troutner
2021-03-02 08:54:07 -08:00
parent 78f462c9ec
commit 36a84726af
3 changed files with 775 additions and 19873 deletions
+765 -19870
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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",
+9 -2
View File
@@ -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
})
}
}