Adding invariant to EscrowTimeoutHelper.closeWithTimeout to require that the escrowTimeoutSPK.timeout branch has a nested SPK of P2PKH

This commit is contained in:
Chris Stewart 2017-06-15 11:25:11 -05:00
parent 98bc0d01b0
commit c855851ca6
2 changed files with 4 additions and 2 deletions

View File

@ -177,7 +177,8 @@ trait LockTimeInterpreter extends BitcoinSLogger {
true
}
/** Checks if the given [[ScriptNumber]] and [[UInt32]] are valid values for locking a OP_CSV by block height */
/** Checks if the given [[ScriptNumber]] and [[UInt32]] are valid values for spending
* a OP_CSV value by block height */
def isCSVLockByBlockHeight(scriptNumber: ScriptNumber, sequence: UInt32): Boolean = {
isCSVLockByBlockHeight(scriptNumber) && isCSVLockByBlockHeight(sequence)
}
@ -187,6 +188,8 @@ trait LockTimeInterpreter extends BitcoinSLogger {
def isCSVLockByBlockHeight(scriptNumber: ScriptNumber): Boolean = !isCSVLockByRelativeLockTime(scriptNumber)
/** Checks if the given [[ScriptNumber]] and [[UInt32]] are valid values
* for spending an OP_CSV value by time based relative lock time */
def isCSVLockByRelativeLockTime(number: ScriptNumber, sequence: UInt32): Boolean = {
isCSVLockByRelativeLockTime(number) && isCSVLockByRelativeLockTime(sequence)
}

View File

@ -72,7 +72,6 @@ class TransactionSignatureCreatorSpec extends Properties("TransactionSignatureCr
val result = ScriptInterpreter.run(program)
Seq(ScriptOk, ScriptErrorPushSize).contains(result)
}
property("fail to verify a transaction with a relative locktime that has not been satisfied yet") =
Prop.forAllNoShrink(TransactionGenerators.unspendableCSVTransaction :| "unspendable csv") {
case (txSignatureComponent: TxSigComponent, _) =>