mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
wallet: clean reserved inputs on startup.
We reserve inputs when we're going to send a transaction, but we don't unreserve them if we crash. This is most graphically demonstrated by the txprepare case, which makes it easier to trigger. Instead, we should query bitcoind to see whether the tx made it out or not, as we would do manually with dev-rescan-outputs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -736,6 +736,10 @@ 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user