loop
loop copied to clipboard
[3/?] StaticAddr: Deposit tracking and timeout sweep
It introduces tracking of deposits to a static address and monitoring of the CSV expiry. Instead of using RegisterConfirmationsNtfn to detect spends to a pkScript, we poll the lnd account of the imported static address taproot script and notify the main event loop of the manager about new deposits to a static address.
~Todo:~
~- state machine recovery~ ~- listening for timeout tx confirmations to be sure that the client claimed funds.~
@bhandras: review reminder @sputn1ck: review reminder
So far this looks good to me! Gonna try to do a test run in a bit
Thank you, for convenience, here are some steps I take to test this.
- reduce the CSV value on the server to be able to timeout after 100 blocks or so.
- create a static address on the client side
loop --network=regtest s n - send coins to it
reg_bob sendcoins --amt 9111123 --addr static_addr_here --min_confs 0 - mine 3 blocks, otherwise the coins are not showing up in
loop --network=regtest s list - check the deposit with
loop --network=regtest s list - mine enough blocks to timeout the deposit...
- restarting between any of these steps should recover
Thanks for the review @bhandras, I plan to add some unit tests to increase test coverage.