Enable txindex=1 as default #37

Closed
kodxana wants to merge 211 commits from master into master
2 changed files with 15 additions and 15 deletions
Showing only changes of commit c6410257eb - Show all commits

View file

@ -194,6 +194,20 @@ func isOpcodeDisabled(opcode byte) bool {
}
}
// isOpcodeAlwaysIllegal returns whether or not the opcode is always illegal
// when passed over by the program counter even if in a non-executed branch (it
// isn't a coincidence that they are conditionals).
func isOpcodeAlwaysIllegal(opcode byte) bool {
switch opcode {
case OP_VERIF:
return true
case OP_VERNOTIF:
return true
default:
return false
}
}
// executeOpcode peforms execution on the passed opcode. It takes into account
// whether or not it is hidden by conditionals, but some rules still must be
// tested in this case.
@ -206,7 +220,7 @@ func (vm *Engine) executeOpcode(pop *parsedOpcode) error {
}
// Always-illegal opcodes are fail on program counter.
if pop.alwaysIllegal() {
if isOpcodeAlwaysIllegal(pop.opcode.value) {
str := fmt.Sprintf("attempt to execute reserved opcode %s",
pop.opcode.name)
return scriptError(ErrReservedOpcode, str)

View file

@ -692,20 +692,6 @@ func (pop *parsedOpcode) checkParseableInScript(script []byte, scriptPos int) (i
return scriptPos, nil
}
// alwaysIllegal returns whether or not the opcode is always illegal when passed
// over by the program counter even if in a non-executed branch (it isn't a
// coincidence that they are conditionals).
func (pop *parsedOpcode) alwaysIllegal() bool {
switch pop.opcode.value {
case OP_VERIF:
return true
case OP_VERNOTIF:
return true
default:
return false
}
}
// isConditional returns whether or not the opcode is a conditional opcode which
// changes the conditional execution stack when executed.
func (pop *parsedOpcode) isConditional() bool {