refactor: remove nested loop
This commit is contained in:
parent
dd3b4116a6
commit
0e39aa78c9
2 changed files with 9 additions and 12 deletions
|
|
@ -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]
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue