Removed unnecessary signTxOutputCustomReader.
This commit is contained in:
parent
d5cc72dc27
commit
a61c0f06cf
1 changed files with 2 additions and 11 deletions
13
script.go
13
script.go
|
@ -6,11 +6,9 @@ package btcscript
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rand"
|
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/conformal/btcec"
|
"github.com/conformal/btcec"
|
||||||
|
@ -1116,15 +1114,8 @@ func SignatureScript(tx *btcwire.MsgTx, idx int, subscript []byte, hashType SigH
|
||||||
return NewScriptBuilder().AddData(sig).AddData(pkData).Script(), nil
|
return NewScriptBuilder().AddData(sig).AddData(pkData).Script(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func signTxOutput(tx *btcwire.MsgTx, idx int, subScript []byte, hashType SigHashType,
|
func signTxOutput(tx *btcwire.MsgTx, idx int, subScript []byte,
|
||||||
key *btcec.PrivateKey) ([]byte, error) {
|
hashType SigHashType, key *btcec.PrivateKey) ([]byte, error) {
|
||||||
|
|
||||||
return signTxOutputCustomReader(rand.Reader, tx, idx, subScript,
|
|
||||||
hashType, key)
|
|
||||||
}
|
|
||||||
|
|
||||||
func signTxOutputCustomReader(reader io.Reader, tx *btcwire.MsgTx, idx int,
|
|
||||||
subScript []byte, hashType SigHashType, key *btcec.PrivateKey) ([]byte, error) {
|
|
||||||
parsedScript, err := parseScript(subScript)
|
parsedScript, err := parseScript(subScript)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot parse output script: %v", err)
|
return nil, fmt.Errorf("cannot parse output script: %v", err)
|
||||||
|
|
Loading…
Reference in a new issue