What changed, and why it matters
This commit is a simple internal variable rename from 'storedPaymentSeq' to 'storedSeq' in the payments database code. It does not change any logic, behavior, or security properties of the software.
No security action needed. This is a non-functional refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff renames a single struct field and its three references in channeldb/payments_kv_store.go. All occurrences of storedPaymentSeq are replaced with storedSeq, including in the struct definition and in the nextPaymentSequence() method. No functional changes, type changes, control flow changes, or security boundary changes are introduced.
Changed components
channeldb/payments_kv_store.goInspect captured patch +5 / −5
diff --git a/channeldb/payments_kv_store.go b/channeldb/payments_kv_store.go
index d75b694..cf2ca91 100644
--- a/channeldb/payments_kv_store.go
+++ b/channeldb/payments_kv_store.go
@@ -120,9 +120,9 @@ var (
// KVPaymentsDB implements persistence for payments and payment attempts.
type KVPaymentsDB struct {
// Sequence management for the kv store.
- seqMu sync.Mutex
- currSeq uint64
- storedPaymentSeq uint64
+ seqMu sync.Mutex
+ currSeq uint64
+ storedSeq uint64
// db is the underlying database implementation.
db kvdb.Backend
@@ -762,7 +762,7 @@ func (p *KVPaymentsDB) nextPaymentSequence() ([]byte, error) {
// Set a new upper bound in the DB every 1000 payments to avoid
// conflicts on the sequence when using etcd.
- if p.currSeq == p.storedPaymentSeq {
+ if p.currSeq == p.storedSeq {
var currPaymentSeq, newUpperBound uint64
if err := kvdb.Update(p.db, func(tx kvdb.RwTx) error {
paymentsBucket, err := tx.CreateTopLevelBucket(
@@ -789,7 +789,7 @@ func (p *KVPaymentsDB) nextPaymentSequence() ([]byte, error) {
p.currSeq = currPaymentSeq
}
- p.storedPaymentSeq = newUpperBound
+ p.storedSeq = newUpperBound
}
p.currSeq++
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.