mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
txscript: Comment improvements and fixes
This commit improves and corrects a few comments in txscript to ensure they match reality.
This commit is contained in:
parent
d272bfebb7
commit
9abc2c0e19
1 changed files with 6 additions and 6 deletions
|
@ -18,8 +18,8 @@ import (
|
||||||
"github.com/btcsuite/golangcrypto/ripemd160"
|
"github.com/btcsuite/golangcrypto/ripemd160"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An opcode defines the information related to a txscript opcode. opfunc if
|
// An opcode defines the information related to a txscript opcode. opfunc, if
|
||||||
// present is the function to call to perform the opcode on the script. The
|
// present, is the function to call to perform the opcode on the script. The
|
||||||
// current script is passed in as a slice with the first member being the opcode
|
// current script is passed in as a slice with the first member being the opcode
|
||||||
// itself.
|
// itself.
|
||||||
type opcode struct {
|
type opcode struct {
|
||||||
|
@ -1106,7 +1106,7 @@ func opcodeToAltStack(op *parsedOpcode, vm *Engine) error {
|
||||||
// opcodeFromAltStack removes the top item from the alternate data stack and
|
// opcodeFromAltStack removes the top item from the alternate data stack and
|
||||||
// pushes it onto the main data stack.
|
// pushes it onto the main data stack.
|
||||||
//
|
//
|
||||||
// Main data stack transformation: [... x1 x2 x3] -> [... x1 x2 x3 y1]
|
// Main data stack transformation: [... x1 x2 x3] -> [... x1 x2 x3 y3]
|
||||||
// Alt data stack transformation: [... y1 y2 y3] -> [... y1 y2]
|
// Alt data stack transformation: [... y1 y2 y3] -> [... y1 y2]
|
||||||
func opcodeFromAltStack(op *parsedOpcode, vm *Engine) error {
|
func opcodeFromAltStack(op *parsedOpcode, vm *Engine) error {
|
||||||
so, err := vm.astack.PopByteArray()
|
so, err := vm.astack.PopByteArray()
|
||||||
|
@ -1163,8 +1163,8 @@ func opcode2Swap(op *parsedOpcode, vm *Engine) error {
|
||||||
|
|
||||||
// opcodeIfDup duplicates the top item of the stack if it is not zero.
|
// opcodeIfDup duplicates the top item of the stack if it is not zero.
|
||||||
//
|
//
|
||||||
// Stack transformation (x1==0): [... x1] -> [...]
|
// Stack transformation (x1==0): [... x1] -> [... x1]
|
||||||
// Stack transformation (x1!=0): [... x1] -> [... x1]
|
// Stack transformation (x1!=0): [... x1] -> [... x1 x1]
|
||||||
func opcodeIfDup(op *parsedOpcode, vm *Engine) error {
|
func opcodeIfDup(op *parsedOpcode, vm *Engine) error {
|
||||||
so, err := vm.dstack.PeekByteArray(0)
|
so, err := vm.dstack.PeekByteArray(0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1965,7 +1965,7 @@ func opcodeCheckSigVerify(op *parsedOpcode, vm *Engine) error {
|
||||||
|
|
||||||
// parsedSigInfo houses a raw signature along with its parsed form and a flag
|
// parsedSigInfo houses a raw signature along with its parsed form and a flag
|
||||||
// for whether or not it has already been parsed. It is used to prevent parsing
|
// for whether or not it has already been parsed. It is used to prevent parsing
|
||||||
// the same signature multiple times when verify a multisig.
|
// the same signature multiple times when verifying a multisig.
|
||||||
type parsedSigInfo struct {
|
type parsedSigInfo struct {
|
||||||
signature []byte
|
signature []byte
|
||||||
parsedSignature *btcec.Signature
|
parsedSignature *btcec.Signature
|
||||||
|
|
Loading…
Add table
Reference in a new issue