Browse Source

wallet: Lowerbound the rescan by going at most back to LNs origin

Repeated crashes could result in the `last_processed_block` variable being
pushed further and further into the past (in some cases going as far back as
scanning blocks from 2012...). This is a stop-gap solution that just lower
bounds the value to what is the first possible block we might be interested in
LN, until we have the 0-rescan fix I'm working on.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
ba3ceb2abf
  1. 4
      wallet/wallet.c

4
wallet/wallet.c

@ -826,6 +826,10 @@ u32 wallet_first_blocknum(struct wallet *w, u32 first_possible)
first_utxo = db_get_intvar(w->db, "last_processed_block", UINT32_MAX);
#endif
/* Never go below the start of the Lightning Network */
if (first_utxo < first_possible)
first_utxo = first_possible;
if (first_utxo < first_channel)
return first_utxo;
else

Loading…
Cancel
Save