Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/bitcoin/script/op_code/constant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class BitcoinOpCodeConst {
static const List<int> emptyTxSequence = [0x00, 0x00, 0x00, 0x00];

static const List<int> absoluteTimelockSequence = [0xfe, 0xff, 0xff, 0xff];
static const List<int> replaceByFeeSequence = [0x01, 0x00, 0x00, 0x00];
static const List<int> replaceByFeeSequence = [0xfd, 0xff, 0xff, 0xff];

/// Script version and Bitcoin-related identifiers
static const int leafVersionTapscript = 0xc0;
Expand Down
10 changes: 6 additions & 4 deletions lib/src/transaction_builder/forked_transaction_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,12 @@ that demonstrate the right to spend the bitcoins associated with the correspondi
});
}
final inputs = sortedUtxos.map((e) => e.utxo.toInput()).toList();
if (enableRBF && inputs.isNotEmpty) {
inputs[0] = inputs[0].copyWith(
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
);
if (enableRBF) {
for (int i = 0; i < inputs.length; i++) {
inputs[i] = inputs[i].copyWith(
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
);
}
}
return (
List<TxInput>.unmodifiable(inputs),
Expand Down
10 changes: 6 additions & 4 deletions lib/src/transaction_builder/transaction_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,12 @@ that demonstrate the right to spend the bitcoins associated with the correspondi
});
}
final inputs = sortedUtxos.map((e) => e.utxo.toInput()).toList();
if (enableRBF && inputs.isNotEmpty) {
inputs[0] = inputs[0].copyWith(
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
);
if (enableRBF) {
for (int i = 0; i < inputs.length; i++) {
inputs[i] = inputs[i].copyWith(
sequence: BitcoinOpCodeConst.replaceByFeeSequence,
);
}
}
return (
List<TxInput>.unmodifiable(inputs),
Expand Down