mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-20 02:11:40 +01:00
Adding invariant to EscrowTimeoutHelper.closeWithTimeout to require that the escrowTimeoutSPK.timeout branch has a nested SPK of P2PKH
This commit is contained in:
parent
98bc0d01b0
commit
c855851ca6
@ -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)
|
||||
}
|
||||
|
@ -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, _) =>
|
||||
|
Loading…
Reference in New Issue
Block a user