Skip to content

Commit

Permalink
logs: Correct an sign mismatch printing the depth change
Browse files Browse the repository at this point in the history
We are checking if `txw->depth` is `-1` and then print it, when we
clearly want `depth` instead.

Changelog-Fixed logs: When printing depths some unsigned numbers could overflow
  • Loading branch information
cdecker authored and rustyrussell committed Dec 6, 2024
1 parent f0c5ea2 commit 1adbd70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightningd/watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ static bool txw_fire(struct txwatch *txw,

if (txw->depth == -1) {
log_debug(txw->topo->log,
"Got first depth change ->%u for %s",
txw->depth,
"Got first depth change 0->%u for %s",
depth,
fmt_bitcoin_txid(tmpctx, &txw->txid));
} else {
/* zero depth signals a reorganization */
Expand Down

0 comments on commit 1adbd70

Please sign in to comment.