wallet: fixed timestamps for invented bookkeeper deposits
What changed, and why it matters
This is a tiny internal fix to make a bookkeeping migration produce stable event ordering. It changes the timestamp used when creating historical 'deposit' records during a one-time database migration, so the records sort consistently with channel records instead of using the real-time clock. There is no security issue here.
No security action required. Treat as normal code-quality/test-stability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
migrate_setup_coinmoves() previously stamped invented bookkeeper deposit coin movements with coinmvt_current_time(), a wall-clock timestamp. On slow systems this could place the deposit after the channel journal entry in bkpr-listaccountevents, causing test flakiness. The patch sets mvt->timestamp = base_timestamp + 1, matching the ordering convention used for channel moves. This is a deterministic timestamp assignment for migration-time records only.
Changed components
wallet/wallet.cmigrate_setup_coinmoves()Inspect captured patch +2 / −0
### wallet/wallet.c
@@ -7827,6 +7827,8 @@ void migrate_setup_coinmoves(struct lightningd *ld, struct db *db)
*utxos[i]->blockheight,
utxos[i]->amount,
mk_mvt_tags(MVT_DEPOSIT));
+ /* Fixed timestamp, after channel_open but before journal. */
+ mvt->timestamp = base_timestamp + 1;
insert_chain_mvt(ld, db, mvt);
}
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.