case class ConditionalCounter(trueCount: Int, falseAndIgnoreCount: Int) extends Product with Serializable
Implements the counting required for O(1) handling of conditionals in Bitcoin Script.
- trueCount
The depth of OP_IFs/OP_NOTIFs we've entered on the true condition before the first false.
- falseAndIgnoreCount
The depth of OP_IFs/OP_NOTIFs we've entered after and including the first false condition. Every OP_IF/OP_NOTIF adds to trueCount or falseAndIgnoreCount. OP_ELSE has an effect only when falseAndIgnoreCount \== 0 or 1, in which case it moves 1 from trueCount to falseAndIgnoreCount or vice versa. OP_ENDIF subtracts one from either falseAndIgnoreCount or trueCount if falseAndIgnoreCount == 0. trueCount + falseAndIgnoreCount represents the current depth in the conditional tree. falseAndIgnoreCount \== 0 represents whether operations should be executed.
- Alphabetic
- By Inheritance
- ConditionalCounter
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ConditionalCounter(trueCount: Int, falseAndIgnoreCount: Int)
- trueCount
The depth of OP_IFs/OP_NOTIFs we've entered on the true condition before the first false.
- falseAndIgnoreCount
The depth of OP_IFs/OP_NOTIFs we've entered after and including the first false condition. Every OP_IF/OP_NOTIF adds to trueCount or falseAndIgnoreCount. OP_ELSE has an effect only when falseAndIgnoreCount \== 0 or 1, in which case it moves 1 from trueCount to falseAndIgnoreCount or vice versa. OP_ENDIF subtracts one from either falseAndIgnoreCount or trueCount if falseAndIgnoreCount == 0. trueCount + falseAndIgnoreCount represents the current depth in the conditional tree. falseAndIgnoreCount \== 0 represents whether operations should be executed.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addCondition(condition: Boolean): ConditionalCounter
Should be called for every OP_IF and OP_NOTIF with whether the first (true) or second (false) branch should be taken.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val falseAndIgnoreCount: Int
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def invertCondition(): ConditionalCounter
Should be called on for every OP_ELSE.
Should be called on for every OP_ELSE.
It is assumed that !noConditionEncountered
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noConditionEncountered: Boolean
- def noFalseEncountered: Boolean
- def noTrueEncountered: Boolean
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def removeCondition(): ConditionalCounter
Should be called on for every OP_ENDIF.
Should be called on for every OP_ENDIF.
It is assumed that !noConditionEncountered
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def totalDepth: Int
- val trueCount: Int
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()