mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
input: use explicit CSV 1 script for to remote output
We undo the prior hack here to make the final script more readable. The difference is just 1 byte between the two.
This commit is contained in:
parent
0c74f894c4
commit
6ce7f5d29e
@ -2231,7 +2231,9 @@ func NewRemoteCommitScriptTree(remoteKey *btcec.PublicKey,
|
||||
builder := txscript.NewScriptBuilder()
|
||||
builder.AddData(schnorr.SerializePubKey(remoteKey))
|
||||
builder.AddOp(txscript.OP_CHECKSIG)
|
||||
builder.AddOp(txscript.OP_1)
|
||||
builder.AddOp(txscript.OP_CHECKSEQUENCEVERIFY)
|
||||
builder.AddOp(txscript.OP_DROP)
|
||||
|
||||
remoteScript, err := builder.Script()
|
||||
if err != nil {
|
||||
@ -2269,12 +2271,7 @@ func NewRemoteCommitScriptTree(remoteKey *btcec.PublicKey,
|
||||
// Our single tapleaf will use the following script:
|
||||
//
|
||||
// <remotepubkey> OP_CHECKSIG
|
||||
// OP_CHECKSEQUENCEVERIFY
|
||||
//
|
||||
// The CSV clause is a bit subtle, but OP_CHECKSIG will return true if it
|
||||
// succeeds, which then enforces our 1 CSV. The true will remain on the stack,
|
||||
// causing the script to pass. If the CHECKSIG fails, then a 0 will remain on
|
||||
// the stack.
|
||||
// 1 OP_CHECKSEQUENCEVERIFY OP_DROP
|
||||
func TaprootCommitScriptToRemote(remoteKey *btcec.PublicKey,
|
||||
) (*btcec.PublicKey, error) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user