Add transaction index in watched_outputs
authorAntoine Riard <ariard@student.42.fr>
Wed, 1 Jul 2020 17:49:11 +0000 (13:49 -0400)
committerAntoine Riard <ariard@student.42.fr>
Sat, 10 Oct 2020 22:51:05 +0000 (18:51 -0400)
commit30aad79df8548d06fdd2270349fadf4afa07ee94
tree886da873d53f63bd4ff6dea15750fcda22981084
parentdf778b605a28580905cb5ca63b3ec8bbe99afc2f
Add transaction index in watched_outputs

Previously, outputs were monitored based on txid and an index yelled
from an enumeration over the returned selected outputs by monitoring
code. This is always have been broken but was only discovered while
introducing anchor outputs as those ones rank always first per BIP69.
We didn't have test cases where a HTLC was bigger than a party balance
on a holder commitment and thus not ranking first.

Next commit introduce test coverage.
lightning/src/chain/chainmonitor.rs
lightning/src/chain/channelmonitor.rs