bumpSequence static method

int bumpSequence(
  1. int currentSequence
)

Bump sequence for a replacement tx. BIP-125 rule 4 requires sequence >= original (miners mostly just check fee, though).

Implementation

static int bumpSequence(int currentSequence) {
  if (currentSequence >= sequenceLocktimeOnly) {
    return sequenceRbfDefault;
  }
  // Increment by 1 if there is room.
  if (currentSequence < sequenceLocktimeOnly - 1) {
    return currentSequence + 1;
  }
  return currentSequence;
}