feat: rbf checking in blockcypher plugin

This commit is contained in:
José Oliveira 2021-04-04 21:45:09 +01:00 committed by Josh Harvey
parent 434d30b079
commit d338d0adca
3 changed files with 43 additions and 14 deletions

View file

@ -126,11 +126,23 @@ function cryptoNetwork (account, cryptoCode) {
.then(() => parseInt(rpcConfig.port, 10) === 18332 ? 'test' : 'main')
}
function fetchRBF (txId) {
return fetch('getmempoolentry', [txId])
.then((res) => _.assign(_.pick(['bip125-replaceable'], res)), { tx_hash: txId })
.catch(err => {
if (err.code === -5) console.log(`${err.message}`)
const result = { tx_hash: txId }
result['bip125-replaceable'] = true
return result
})
}
module.exports = {
balance,
sendCoins,
newAddress,
getStatus,
newFunding,
cryptoNetwork
cryptoNetwork,
fetchRBF
}