multi: move Input interface and related code

This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
This commit is contained in:
Joost Jager committed 2019-01-31 13:25:33 +01:00
1 parent 667474db75
commit 9e012ecc93
66 files changed
+811 -689

No files matched your search

+4 -3
View File
@@ -14,6 +14,7 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/lnwallet"
)
@@ -93,7 +94,7 @@ type chainWatcherConfig struct {
// signer is the main signer instances that will be responsible for
// signing any HTLC and commitment transaction generated by the state
// machine.
signer lnwallet.Signer
signer input.Signer
// contractBreach is a method that will be called by the watcher if it
// detects that a contract breach transaction has been confirmed. Only
@@ -191,13 +192,13 @@ func (c *chainWatcher) Start() error {
localKey := chanState.LocalChanCfg.MultiSigKey.PubKey.SerializeCompressed()
remoteKey := chanState.RemoteChanCfg.MultiSigKey.PubKey.SerializeCompressed()
multiSigScript, err := lnwallet.GenMultiSigScript(
multiSigScript, err := input.GenMultiSigScript(
localKey, remoteKey,
)
if err != nil {
return err
}
pkScript, err := lnwallet.WitnessScriptHash(multiSigScript)
pkScript, err := input.WitnessScriptHash(multiSigScript)
if err != nil {
return err
}