From ad943821d94f874c28b798c63e59d30effcb3913 Mon Sep 17 00:00:00 2001 From: Tom McCabe Date: Fri, 26 Aug 2016 09:27:17 -0500 Subject: [PATCH] remove apply functions inside CLTV/CSVScriptPubKeys that would produce a P2PKH-formatted ScriptPubKey --- .../core/protocol/script/ScriptPubKey.scala | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/main/scala/org/bitcoins/core/protocol/script/ScriptPubKey.scala b/src/main/scala/org/bitcoins/core/protocol/script/ScriptPubKey.scala index 16e5c6b17d..293295b586 100644 --- a/src/main/scala/org/bitcoins/core/protocol/script/ScriptPubKey.scala +++ b/src/main/scala/org/bitcoins/core/protocol/script/ScriptPubKey.scala @@ -358,20 +358,6 @@ object CLTVScriptPubKey extends Factory[CLTVScriptPubKey] { def apply (asm: Seq[ScriptToken]) : CLTVScriptPubKey = fromAsm(asm) - /** - * Creates a P2PKH-formatted CLTVScriptPubKey - * @param locktime block height or timestamp - * @param pubKey public key corresponding to the CLTV output - * @return - */ - def apply(locktime : ScriptNumber, pubKey : ECPublicKey) : CLTVScriptPubKey = { - val pushOpsLockTime = BitcoinScriptUtil.calculatePushOp(locktime.bytes) - val pushOpsPubKey = BitcoinScriptUtil.calculatePushOp(pubKey.bytes) - val asm = pushOpsLockTime ++ Seq(ScriptConstant(locktime.bytes)) ++ Seq(OP_CHECKLOCKTIMEVERIFY, OP_DROP, OP_DUP, OP_HASH160) ++ - pushOpsPubKey ++ Seq(ScriptConstant(pubKey.bytes)) ++ Seq(OP_CHECKSIG) - CLTVScriptPubKey(asm) - } - def apply(locktime : ScriptNumber, scriptPubKey : ScriptPubKey) : CLTVScriptPubKey = { val pushOpsLockTime= BitcoinScriptUtil.calculatePushOp(locktime.bytes) val cltvAsm = pushOpsLockTime ++ Seq(ScriptConstant(locktime.bytes)) ++ Seq(OP_CHECKLOCKTIMEVERIFY, OP_DROP) @@ -416,20 +402,6 @@ object CSVScriptPubKey extends Factory[CSVScriptPubKey] { def apply(asm : Seq[ScriptToken]) : CSVScriptPubKey = fromAsm(asm) - /** - * Creates P2PKH-formatted CSVScriptPubKey - * @param relativeLockTime number of blocks OR timestamp to lock coins - * @param pubKey public key corresponding to CSV output - * @return - */ - def apply(relativeLockTime : ScriptNumber, pubKey : ECPublicKey) : CSVScriptPubKey = { - val pushOpsTimeStamp = BitcoinScriptUtil.calculatePushOp(relativeLockTime.bytes) - val pushOpsPubKey = BitcoinScriptUtil.calculatePushOp(pubKey.bytes) - val asm = pushOpsTimeStamp ++ Seq(ScriptConstant(relativeLockTime.bytes)) ++ Seq(OP_CHECKSEQUENCEVERIFY, OP_DROP, OP_DUP, OP_HASH160) ++ - pushOpsPubKey ++ Seq(ScriptConstant(pubKey.bytes)) ++ Seq(OP_CHECKSIG) - CSVScriptPubKey(asm) - } - def apply(relativeLockTime : ScriptNumber, scriptPubKey : ScriptPubKey) : CSVScriptPubKey = { val pushOpsLockTime= BitcoinScriptUtil.calculatePushOp(relativeLockTime.bytes) val csvAsm = pushOpsLockTime ++ Seq(ScriptConstant(relativeLockTime.bytes)) ++ Seq(OP_CHECKSEQUENCEVERIFY, OP_DROP)