lnwallet: publicy export WitnessScriptHash and GenMultiSigScript

In this commit, we export WitnessScriptHash and GenMultiSigScript as
external sub-systems may now need to use these methods in order to be
able to watch for confirmations based on the script of a transaction.
This commit is contained in:
Olaoluwa Osuntokun 2018-05-30 22:10:08 -07:00
parent c707577e99
commit 8dd0b56d35
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
2 changed files with 4 additions and 4 deletions

@ -1427,7 +1427,7 @@ func (lc *LightningChannel) createSignDesc() error {
localKey := lc.localChanCfg.MultiSigKey.PubKey.SerializeCompressed()
remoteKey := lc.remoteChanCfg.MultiSigKey.PubKey.SerializeCompressed()
multiSigScript, err := genMultiSigScript(localKey, remoteKey)
multiSigScript, err := GenMultiSigScript(localKey, remoteKey)
if err != nil {
return err
}

@ -57,9 +57,9 @@ func WitnessScriptHash(witnessScript []byte) ([]byte, error) {
return bldr.Script()
}
// genMultiSigScript generates the non-p2sh'd multisig script for 2 of 2
// GenMultiSigScript generates the non-p2sh'd multisig script for 2 of 2
// pubkeys.
func genMultiSigScript(aPub, bPub []byte) ([]byte, error) {
func GenMultiSigScript(aPub, bPub []byte) ([]byte, error) {
if len(aPub) != 33 || len(bPub) != 33 {
return nil, fmt.Errorf("Pubkey size error. Compressed pubkeys only")
}
@ -91,7 +91,7 @@ func GenFundingPkScript(aPub, bPub []byte, amt int64) ([]byte, *wire.TxOut, erro
}
// First, create the 2-of-2 multi-sig script itself.
witnessScript, err := genMultiSigScript(aPub, bPub)
witnessScript, err := GenMultiSigScript(aPub, bPub)
if err != nil {
return nil, nil, err
}