coin moves: log all withdrawals when confirmed in a block

This moves the notification for our coin spends from when it's
successfully submited to the mempool to when they're confirmed in a
block.

We also add an 'informational' notice tagged as `spend_track` which
can be used to track which transaction a wallet output was spent in.
This commit is contained in:
lisa neigut
2020-04-03 16:56:57 -05:00
committed by Rusty Russell
parent e9d26a46e0
commit de86e29e16
8 changed files with 214 additions and 85 deletions

View File

@@ -1381,6 +1381,7 @@ def test_coin_movement_notices(node_factory, bitcoind):
]
l2_wallet_mvts = [
{'type': 'chain_mvt', 'credit': 2000000000, 'debit': 0, 'tag': 'deposit'},
{'type': 'chain_mvt', 'credit': 0, 'debit': 0, 'tag': 'spend_track'},
{'type': 'chain_mvt', 'credit': 0, 'debit': 995418000, 'tag': 'withdrawal'},
{'type': 'chain_mvt', 'credit': 0, 'debit': 1000000000, 'tag': 'withdrawal'},
{'type': 'chain_mvt', 'credit': 0, 'debit': 4582000, 'tag': 'chain_fees'},