Compare commits

..
2 Commits
Author SHA1 Message Date
Chris Troutner 65314439d7 Merge pull request #108 from Permissionless-Software-Foundation/ct-unstable
fix(hydrateUtxos): Allow users to pass in utxoDelay
2021-03-02 08:55:38 -08:00
Chris Troutner 36a84726af fix(hydrateUtxos): Allow users to pass in utxoDelay 2021-03-02 08:54:07 -08:00
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" "node": ">=10.15.1"
}, },
"dependencies": { "dependencies": {
"@psf/bch-js": "^4.15.19", "@psf/bch-js": "^4.15.21",
"apidoc": "^0.26.0", "apidoc": "^0.26.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"bitcore-lib-cash": "^8.23.1", "bitcore-lib-cash": "^8.23.1",
+9 -2
View File
@@ -1979,6 +1979,11 @@ class Slp {
try { try {
const utxos = req.body.utxos 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: ', req)
// console.log(`req._remoteAddress: ${req._remoteAddress}`) // console.log(`req._remoteAddress: ${req._remoteAddress}`)
@@ -1988,7 +1993,8 @@ class Slp {
ip: req._remoteAddress, ip: req._remoteAddress,
jwtToken: req.locals.jwtToken, jwtToken: req.locals.jwtToken,
proLimit: req.locals.proLimit, proLimit: req.locals.proLimit,
apiLevel: req.locals.apiLevel apiLevel: req.locals.apiLevel,
utxoDelay
} }
// Validate inputs // Validate inputs
@@ -2049,7 +2055,8 @@ class Slp {
res.status(500) res.status(500)
return res.json({ return res.json({
error: 'Error in hydrateUtxos()' error: 'Undetermined error in hydrateUtxos()',
message: err.message
}) })
} }
} }