From 21849329dd76ed34bc1c154f1b523133565b22e5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 16 Feb 2018 08:39:53 +1030 Subject: [PATCH] wallet: store last block number we searched for UTXOs. We already go back 100 from this in case of reorgs, so the block number itself is sufficient. Signed-off-by: Rusty Russell --- lightningd/chaintopology.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 33bc68346..b8cb6a614 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -348,6 +348,10 @@ static void updates_complete(struct chain_topology *topo) /* Maybe need to rebroadcast. */ rebroadcast_txs(topo, NULL); + /* We've processed these UTXOs */ + db_set_intvar(topo->bitcoind->ld->wallet->db, + "last_processed_block", topo->tip->height); + topo->prev_tip = topo->tip; }