refactor: remove nested loop

This commit is contained in:
José Oliveira 2021-04-06 10:40:35 +01:00 committed by Josh Harvey
parent dd3b4116a6
commit 0e39aa78c9
2 changed files with 9 additions and 12 deletions

View file

@ -128,12 +128,12 @@ function cryptoNetwork (account, cryptoCode) {
function fetchRBF (txId) {
return fetch('getmempoolentry', [txId])
.then((res) => _.assign(_.pick(['bip125-replaceable'], res)), { tx_hash: txId })
.then((res) => {
return [txId, res['bip125-replaceable']]
})
.catch(err => {
if (err.code === -5) console.log(`${err.message}`)
const result = { tx_hash: txId }
result['bip125-replaceable'] = true
return result
return [txId, true]
})
}