Skip to content

Commit 23b0fe3

Browse files
committed
bitcoin-tx: rbfoptin: Avoid touching nSequence if the value is already opting in
1 parent b005bf2 commit 23b0fe3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bitcoin-tx.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ static void MutateTxRBFOptIn(CMutableTransaction& tx, const std::string& strInId
216216
int cnt = 0;
217217
for (CTxIn& txin : tx.vin) {
218218
if (strInIdx == "" || cnt == inIdx) {
219-
txin.nSequence = MAX_BIP125_RBF_SEQUENCE;
219+
if (txin.nSequence > MAX_BIP125_RBF_SEQUENCE) {
220+
txin.nSequence = MAX_BIP125_RBF_SEQUENCE;
221+
}
220222
}
221223
++cnt;
222224
}

0 commit comments

Comments
 (0)