Skip to content

Commit

Permalink
fix: add vout
Browse files Browse the repository at this point in the history
  • Loading branch information
David Case committed Nov 10, 2023
1 parent 3ee1ceb commit c00d51d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bob.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"github.com/bitcoinschema/go-bpu"
)

func NewSigFromTape(tape bpu.Tape) (s *Sig) {
func NewSigFromTape(tape bpu.Tape, vout int) (s *Sig) {
s = new(Sig)
s.FromTape(tape)
s.FromTape(tape, vout)
return
}

// FromTape takes a BOB Tape and returns an Aip data structure.
// Using the FromTape() alone will prevent validation (data is needed via SetData to enable)
func (s *Sig) FromTape(tape bpu.Tape) {
func (s *Sig) FromTape(tape bpu.Tape, vout int) {

// Not a valid tape?
if len(tape.Cell) < 4 {
Expand All @@ -35,6 +35,7 @@ func (s *Sig) FromTape(tape bpu.Tape) {
if !found || len(tape.Cell) < 5 {
return
}
s.TargetVout = vout
// Set the SIGMA fields
if tape.Cell[startIndex+1].S != nil {
s.Algorithm = Algorithm(*tape.Cell[startIndex+1].S)
Expand Down

0 comments on commit c00d51d

Please sign in to comment.