MCPcopy Index your code
hub / github.com/btcsuite/btcd / opcodeEqual

Function opcodeEqual

txscript/opcode.go:1397–1409  ·  view source on GitHub ↗

opcodeEqual removes the top 2 items of the data stack, compares them as raw bytes, and pushes the result, encoded as a boolean, back to the stack. Stack transformation: [... x1 x2] -> [... bool]

(op *opcode, data []byte, vm *Engine)

Source from the content-addressed store, hash-verified

1395//
1396// Stack transformation: [... x1 x2] -> [... bool]
1397func opcodeEqual(op *opcode, data []byte, vm *Engine) error {
1398 a, err := vm.dstack.PopByteArray()
1399 if err != nil {
1400 return err
1401 }
1402 b, err := vm.dstack.PopByteArray()
1403 if err != nil {
1404 return err
1405 }
1406
1407 vm.dstack.PushBool(bytes.Equal(a, b))
1408 return nil
1409}
1410
1411// opcodeEqualVerify is a combination of opcodeEqual and opcodeVerify.
1412// Specifically, it removes the top 2 items of the data stack, compares them,

Callers 1

opcodeEqualVerifyFunction · 0.85

Calls 2

PopByteArrayMethod · 0.80
PushBoolMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…