furszy
77de5c693f
wallet: guard and alert about a wallet invalid state during chain sync
...
-Context:
If `AddToWallet` db write fails, the method returns a wtx nullptr without
removing the recently added transaction from the wallet's map.
-Problem:
When a db write error occurs, `AddToWalletIfInvolvingMe` return false even
when the tx is on the wallet's map already --> which makes `SyncTransaction`
skip the `MarkInputsDirty` call --> which leads to a wallet invalid state
where the inputs of this new transaction are not marked dirty, while the
transaction that spends them still exist on the in-memory wallet tx map.
Plus, as we only store arriving transaction inside `AddToWalletIfInvolvingMe`
when we synchronize/scan blocks from the chain and nowhere else, it makes sense
to treat the tx db write error as a runtime error to notify the user about the
problem. Otherwise, the user will lose all the not stored transactions after a
wallet shutdown (without be able to recover them automatically on the next
startup because the chain sync would be above the block where the txs arrived).
2022-07-18 11:29:27 -03:00
..
2022-07-12 13:56:48 +02:00
2022-04-22 09:04:39 -05:00
2022-05-28 09:43:02 +01:00
2022-06-22 09:54:15 +02:00
2021-09-29 14:10:29 +02:00
2022-06-10 12:39:08 +01:00
2022-07-07 17:59:02 +01:00
2022-06-14 10:38:51 +02:00
2022-07-12 19:20:01 +02:00
2021-10-05 11:10:47 -04:00
2022-07-14 08:27:54 -04:00
2022-03-02 15:25:48 +01:00
2022-02-16 14:59:20 +02:00
2022-06-29 16:35:02 +01:00
2022-07-12 08:02:22 +02:00
2022-06-29 09:13:31 +02:00
2022-02-19 09:35:10 +01:00
2022-07-15 21:18:58 +01:00
2022-07-14 20:53:23 +02:00
2022-07-14 12:11:44 +02:00
2022-06-11 14:55:18 +01:00
2022-06-20 12:22:05 +01:00
2022-07-17 08:04:24 +08:00
2022-07-18 09:15:18 +01:00
2022-07-14 10:04:42 +02:00
2022-07-18 11:29:27 -03:00
2022-06-06 12:12:03 +02:00
2022-04-26 10:43:33 +01:00
2021-11-12 11:46:34 +01:00
2022-05-17 17:19:07 +01:00
2022-05-12 08:57:22 +02:00
2022-04-20 14:29:29 +01:00
2022-04-20 14:35:52 +01:00
2022-06-08 13:35:32 +02:00
2022-04-20 14:29:29 +01:00
2022-04-14 07:15:22 +02:00
2022-04-14 19:26:22 +02:00
2022-06-14 10:38:51 +02:00
2022-05-20 15:17:00 +02:00
2022-04-27 14:16:35 +02:00
2022-05-21 13:54:33 -05:00
2022-02-25 09:43:54 +01:00
2021-12-06 14:17:41 +13:00
2022-07-14 08:35:23 -04:00
2022-06-11 14:55:13 +01:00
2022-06-11 14:55:13 +01:00
2022-06-11 14:55:13 +01:00
2022-06-11 14:55:13 +01:00
2022-06-14 10:38:51 +02:00
2022-05-17 10:37:10 +01:00
2022-05-17 10:37:10 +01:00
2022-05-02 16:04:00 +09:00
2022-05-02 16:04:00 +09:00
2022-01-25 10:49:46 +01:00
2022-02-15 09:29:53 -05:00
2022-04-11 22:19:46 +02:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2022-02-22 15:15:27 +01:00
2022-05-12 02:25:55 +10:00
2022-02-22 15:36:19 +00:00
2022-02-22 15:36:19 +00:00
2021-12-30 19:36:57 +02:00
2022-06-21 16:19:10 +02:00
2022-06-20 12:22:05 +01:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2022-05-21 13:54:33 -05:00
2022-05-04 07:34:47 +02:00
2022-03-30 20:11:15 +01:00
2022-01-07 13:37:47 -05:00
2022-06-23 15:33:01 +02:00
2022-06-23 13:59:25 +02:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2022-05-10 12:09:33 +10:00
2022-05-10 12:09:33 +10:00
2022-02-16 15:02:26 +02:00
2022-05-07 11:09:52 +02:00
2022-04-21 12:01:00 -05:00
2022-06-20 12:22:05 +01:00
2022-04-21 12:01:00 -05:00
2021-12-30 19:36:57 +02:00
2022-05-21 13:54:33 -05:00
2022-05-18 19:15:03 +02:00
2021-12-30 19:36:57 +02:00
2022-06-15 08:10:38 +02:00
2022-04-06 13:19:36 +01:00
2022-06-22 09:19:43 +02:00
2022-05-12 02:25:55 +10:00
2022-07-14 08:35:23 -04:00
2022-06-02 11:42:12 -04:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2022-04-27 19:53:37 +02:00
2022-04-27 19:53:37 +02:00
2022-06-02 22:30:30 +08:00
2022-06-08 14:02:54 +02:00
2022-07-13 16:18:44 +01:00
2022-05-04 20:36:09 +02:00
2022-04-26 16:25:38 -04:00
2022-06-23 15:33:01 +02:00
2021-10-21 09:37:30 +08:00
2022-02-28 16:59:56 +01:00
2022-06-14 16:55:22 +02:00
2022-04-11 16:56:34 -04:00
2022-04-11 16:56:34 -04:00
2022-04-11 16:56:34 -04:00
2022-07-18 09:15:18 +01:00
2021-10-11 20:46:25 +08:00
2022-04-26 10:41:45 +01:00
2022-07-06 20:57:29 -04:00
2022-06-28 15:46:10 -04:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2022-07-12 13:38:14 -04:00
2022-05-27 16:59:45 +02:00
2022-05-18 19:15:03 +02:00
2021-12-30 19:36:57 +02:00
2022-07-07 20:01:01 +01:00
2022-07-06 18:13:54 +02:00
2022-05-17 17:18:58 +01:00
2022-05-21 13:54:33 -05:00
2022-05-21 01:23:23 +10:00
2022-04-15 09:39:25 +02:00
2022-04-25 15:09:14 +02:00
2022-04-20 14:35:53 +01:00
2022-06-14 10:38:51 +02:00
2021-12-30 19:36:57 +02:00
2022-05-21 13:54:33 -05:00
2022-05-16 16:25:47 +02:00
2021-12-30 19:36:57 +02:00
2022-05-30 13:55:39 +02:00
2022-06-27 16:47:48 -04:00
2022-06-27 16:47:48 -04:00
2021-12-30 19:36:57 +02:00
2022-06-27 16:47:48 -04:00
2022-06-21 22:54:55 +07:00
2022-05-12 08:57:22 +02:00
2022-05-01 10:39:40 +01:00
2021-12-30 19:36:57 +02:00
2022-06-15 17:28:55 -04:00
2022-03-10 12:01:53 +01:00
2022-05-17 17:18:58 +01:00
2022-05-12 02:25:55 +10:00
2022-04-26 09:41:45 +01:00
2022-06-14 10:38:51 +02:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2021-12-30 19:36:57 +02:00
2022-04-26 09:41:45 +01:00
2022-02-09 17:21:04 +01:00
2021-12-30 19:36:57 +02:00
2022-05-21 01:23:23 +10:00
2022-05-12 02:25:55 +10:00
2022-06-14 10:38:51 +02:00
2022-03-02 15:40:30 +01:00
2022-06-08 14:02:54 +02:00
2022-03-15 01:33:52 +00:00
2022-06-21 16:19:10 +02:00
2022-03-10 13:05:29 +01:00
2022-07-06 20:57:29 -04:00
2022-07-06 20:57:29 -04:00
2021-12-30 19:36:57 +02:00
2022-01-02 11:40:31 +01:00
2022-07-06 20:57:29 -04:00
2022-07-14 08:27:54 -04:00
2022-05-21 13:54:33 -05:00
2022-05-09 18:35:44 +02:00
2022-05-05 15:55:44 +02:00
2022-05-12 02:25:55 +10:00
2022-01-06 22:14:16 -05:00
2022-05-21 01:23:23 +10:00
2021-12-30 19:36:57 +02:00