Skip to content

Commit 43e0f54

Browse files
committed
Apply RBF nsequence to all inputs, not just inputs[0]
1 parent 252b96d commit 43e0f54

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

lib/src/transaction_builder/forked_transaction_builder.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,12 @@ that demonstrate the right to spend the bitcoins associated with the correspondi
264264
});
265265
}
266266
final inputs = sortedUtxos.map((e) => e.utxo.toInput()).toList();
267-
if (enableRBF && inputs.isNotEmpty) {
268-
inputs[0] = inputs[0].copyWith(
269-
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
270-
);
267+
if (enableRBF) {
268+
for (int i = 0; i < inputs.length; i++) {
269+
inputs[i] = inputs[i].copyWith(
270+
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
271+
);
272+
}
271273
}
272274
return (
273275
List<TxInput>.unmodifiable(inputs),

lib/src/transaction_builder/transaction_builder.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,12 @@ that demonstrate the right to spend the bitcoins associated with the correspondi
414414
});
415415
}
416416
final inputs = sortedUtxos.map((e) => e.utxo.toInput()).toList();
417-
if (enableRBF && inputs.isNotEmpty) {
418-
inputs[0] = inputs[0].copyWith(
419-
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
420-
);
417+
if (enableRBF) {
418+
for (int i = 0; i < inputs.length; i++) {
419+
inputs[i] = inputs[i].copyWith(
420+
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
421+
);
422+
}
421423
}
422424
return (
423425
List<TxInput>.unmodifiable(inputs),

0 commit comments

Comments
 (0)