lightningd: clean utxos after the topology is setup

We need our Bitcoin backend to be ready to get infos about some utxos
This commit is contained in:
darosior 2020-02-05 10:27:03 +01:00 committed by Rusty Russell
parent 580556b1d0
commit 06d598efc1

View File

@ -839,10 +839,6 @@ int main(int argc, char *argv[])
else if (max_blockheight != UINT32_MAX)
max_blockheight -= ld->config.rescan;
/*~ Tell the wallet to start figuring out what to do for any reserved
* unspent outputs we may have crashed with. */
wallet_clean_utxos(ld->wallet, ld->topology->bitcoind);
/*~ That's all of the wallet db operations for now. */
db_commit_transaction(ld->wallet->db);
@ -851,10 +847,14 @@ int main(int argc, char *argv[])
setup_topology(ld->topology, ld->timers,
min_blockheight, max_blockheight);
db_begin_transaction(ld->wallet->db);
/*~ Tell the wallet to start figuring out what to do for any reserved
* unspent outputs we may have crashed with. */
wallet_clean_utxos(ld->wallet, ld->topology->bitcoind);
/*~ Pull peers, channels and HTLCs from db. Needs to happen after the
* topology is initialized since some decisions rely on being able to
* know the blockheight. */
db_begin_transaction(ld->wallet->db);
unconnected_htlcs_in = load_channels_from_wallet(ld);
db_commit_transaction(ld->wallet->db);