From 23b0fe34f526693985099d9160806d00d48a9ecd Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 3 Feb 2017 19:14:02 +0000 Subject: [PATCH] bitcoin-tx: rbfoptin: Avoid touching nSequence if the value is already opting in --- src/bitcoin-tx.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index a67c42ec503..367801dd787 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -216,7 +216,9 @@ static void MutateTxRBFOptIn(CMutableTransaction& tx, const std::string& strInId int cnt = 0; for (CTxIn& txin : tx.vin) { if (strInIdx == "" || cnt == inIdx) { - txin.nSequence = MAX_BIP125_RBF_SEQUENCE; + if (txin.nSequence > MAX_BIP125_RBF_SEQUENCE) { + txin.nSequence = MAX_BIP125_RBF_SEQUENCE; + } } ++cnt; }