mirror of
https://github.com/muun/recovery.git
synced 2025-11-12 06:50:18 -05:00
fix vendor folder
This commit is contained in:
16
vendor/github.com/muun/libwallet/segwit.go
generated
vendored
16
vendor/github.com/muun/libwallet/segwit.go
generated
vendored
@@ -8,6 +8,22 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func signNativeSegwitInput(input Input, index int, tx *wire.MsgTx, privateKey *HDPrivateKey, witnessScript []byte) ([]byte, error) {
|
||||
|
||||
privKey, err := privateKey.key.ECPrivKey()
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to produce EC priv key for signing")
|
||||
}
|
||||
|
||||
sigHashes := txscript.NewTxSigHashes(tx)
|
||||
sig, err := txscript.RawTxInWitnessSignature(tx, sigHashes, index, input.OutPoint().Amount(), witnessScript, txscript.SigHashAll, privKey)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to sign V4 input")
|
||||
}
|
||||
|
||||
return sig, nil
|
||||
}
|
||||
|
||||
func createNonNativeSegwitRedeemScript(witnessScript []byte) ([]byte, error) {
|
||||
witnessScriptHash := sha256.Sum256(witnessScript)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user