diff --git a/src/common/utxobased/engine/makeUtxoEngine.ts b/src/common/utxobased/engine/makeUtxoEngine.ts index 29b4092d..77e8e350 100644 --- a/src/common/utxobased/engine/makeUtxoEngine.ts +++ b/src/common/utxobased/engine/makeUtxoEngine.ts @@ -473,7 +473,8 @@ export async function makeUtxoEngine( outputs: tx.outputs }, edgeSpendInfo, - ourScriptPubkeys + ourScriptPubkeys, + rbfTxid } const transaction: EdgeTransaction = { @@ -515,6 +516,24 @@ export async function makeUtxoEngine( }, async saveTx(edgeTx: EdgeTransaction): Promise { + // Update rbfTxid if it exists + const rbfTxid: string | undefined = edgeTx.otherParams?.rbfTxid + if (rbfTxid != null) { + // Get the replaced transaction using the rbfTxid + const [rbfTx] = await processor.fetchTransactions({ txId: rbfTxid }) + if (rbfTx != null) { + rbfTx.blockHeight = -1 + await transactionChanged({ + walletId: walletInfo.id, + tx: rbfTx, + pluginInfo, + emitter, + walletTools, + processor + }) + } + } + const tx = fromEdgeTransaction(edgeTx) await transactionChanged({ walletId: walletInfo.id, diff --git a/src/common/utxobased/engine/types.ts b/src/common/utxobased/engine/types.ts index 350a81b3..dea23c1d 100644 --- a/src/common/utxobased/engine/types.ts +++ b/src/common/utxobased/engine/types.ts @@ -27,6 +27,7 @@ export interface UtxoTxOtherParams { } edgeSpendInfo?: EdgeSpendInfo ourScriptPubkeys: string[] + rbfTxid?: string } export type UtxoSignMessageOtherParams = ReturnType<