feat: rbf checking in blockcypher plugin
This commit is contained in:
parent
434d30b079
commit
d338d0adca
3 changed files with 43 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue