test: add comprehensive integration tests for on-chain HTLC handling
In this commit, we add 6 new integration tests to test the various actions that may need to be performed when either side goes on-chain to fully resolve HTLC’s. Many of the tests are mirrors of each other as they test sweeping/resolving HTLC’s from both commitment transactions.
This commit is contained in:
5 files changed
+1399
-15
No files matched your search
+7
-3
@@ -941,9 +941,13 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
|
||||
// add it to to our preimage cache. By doing this, we ensure
|
||||
// any contested contracts watched by any on-chain arbitrators
|
||||
// can now sweep this HTLC on-chain.
|
||||
if err := l.cfg.PreimageCache.AddPreimage(pre[:]); err != nil {
|
||||
log.Errorf("unable to add preimage=%x to cache", pre[:])
|
||||
}
|
||||
go func() {
|
||||
err := l.cfg.PreimageCache.AddPreimage(pre[:])
|
||||
if err != nil {
|
||||
log.Errorf("unable to add preimage=%x to "+
|
||||
"cache", pre[:])
|
||||
}
|
||||
}()
|
||||
|
||||
case *lnwire.UpdateFailMalformedHTLC:
|
||||
// Convert the failure type encoded within the HTLC fail
|
||||
|
||||
Reference in new issue
Block a user