Skip to content

Commit

Permalink
fixup! txscript/engine: add execution StepCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
halseth committed May 11, 2023
1 parent 4c4732b commit d1cb5de
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions txscript/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,6 @@ type StepInfo struct {
// OpcodeIndex is the index of the next opcode that will be executed.
OpcodeIndex int

// Witness is the witness of the current input.
//
// NOTE: this will be only be set before the witness program has been
// verified.
Witness [][]byte

// Stack is the Engine's current content on the stack:
Stack [][]byte

Expand Down Expand Up @@ -1070,7 +1064,6 @@ func (vm *Engine) Execute() (err error) {
stepInfo = &StepInfo{
ScriptIndex: vm.scriptIdx,
OpcodeIndex: vm.opcodeIdx,
Witness: vm.tx.TxIn[vm.txIdx].Witness,
Stack: vm.dstack.stk,
AltStack: vm.astack.stk,
}
Expand Down Expand Up @@ -1121,18 +1114,9 @@ func (vm *Engine) Execute() (err error) {
opcodeIdx = stepInfo.OpcodeIndex + 1
}

witness := vm.tx.TxIn[vm.txIdx].Witness

// When the witness script (index 2) is being executed,
// the input witness is no longer relevant.
if scriptIdx > 1 {
witness = nil
}

stepInfo = &StepInfo{
ScriptIndex: scriptIdx,
OpcodeIndex: opcodeIdx,
Witness: witness,
Stack: vm.dstack.stk,
AltStack: vm.astack.stk,
}
Expand Down

0 comments on commit d1cb5de

Please sign in to comment.