Skip to content

Commit

Permalink
txscript: Make op callbacks take opcode and data.
Browse files Browse the repository at this point in the history
This converts the callback function defined on the internal opcode
struct to accept the opcode and data slice instead of a parsed opcode as
the final step towards removing the parsed opcode struct and associated
supporting code altogether.

It also updates all of the callbacks and tests accordingly and finally
removes the now unused parsedOpcode struct.
  • Loading branch information
davecgh committed Mar 26, 2019
1 parent 5059be9 commit 6adbaa6
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 117 deletions.
3 changes: 1 addition & 2 deletions txscript/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ func (vm *Engine) executeOpcode(op *opcode, data []byte) error {
}
}

pop := parsedOpcode{opcode: op, data: data}
return op.opfunc(&pop, vm)
return op.opfunc(op, data, vm)
}

// checkValidPC returns an error if the current script position is not valid for
Expand Down
Loading

0 comments on commit 6adbaa6

Please sign in to comment.