Skip to content

Commit

Permalink
Merge pull request #391 from EdgeApp/sam/rbf-fixes
Browse files Browse the repository at this point in the history
Add missing check for currency RBF capabilities in accelerate method
  • Loading branch information
samholmes authored Nov 10, 2023
2 parents 5bbdb93 + eea3add commit ba799cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- changed: Disabled RBF for Litecoin
- fixed: Respect `canReplaceByFee` flag from currency info in engine `accelerate` function

## 2.5.0 (2023-10-31)

- added: `accelerate` method to `UtxoEngine` for RBF support.
Expand Down
3 changes: 3 additions & 0 deletions src/common/utxobased/engine/makeUtxoEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ export async function makeUtxoEngine(

const engine: EdgeCurrencyEngine = {
async accelerate(edgeTx: EdgeTransaction): Promise<EdgeTransaction | null> {
const { canReplaceByFee = false } = currencyInfo
if (!canReplaceByFee) return null

// Get the replaced transaction from the processor:
const replacedTxid = edgeTx.txid
const [replacedTx] = await processor.fetchTransactions({
Expand Down
2 changes: 1 addition & 1 deletion src/common/utxobased/info/litecoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const currencyInfo: EdgeCurrencyInfo = {
],
enableCustomServers: false
},
canReplaceByFee: true,
canReplaceByFee: false,
customFeeTemplate: [
{
type: 'nativeAmount',
Expand Down

0 comments on commit ba799cb

Please sign in to comment.