cnct: reuse sweep tx logic for commit resolver

Removes duplicate sweep tx code from commit resolver
and delegates generation to UtxoSweeper in the sweep
package.
This commit is contained in:
Joost Jager
2018-09-26 09:46:48 -07:00
parent 7d69df77ed
commit c1d845aa0d
4 changed files with 23 additions and 42 deletions

View File

@@ -3,6 +3,7 @@ package contractcourt
import (
"errors"
"fmt"
"github.com/lightningnetwork/lnd/sweep"
"sync"
"sync/atomic"
@@ -130,6 +131,9 @@ type ChainArbitratorConfig struct {
// DisableChannel disables a channel, resulting in it not being able to
// forward payments.
DisableChannel func(wire.OutPoint) error
// Sweeper allows resolvers to sweep their final outputs.
Sweeper *sweep.UtxoSweeper
}
// ChainArbitrator is a sub-system that oversees the on-chain resolution of all