mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopout: attempt cooperative musig2 sweep
This commit adds optional cooperative musig2 sweep by calling the server to create a partial signature for the sweep if we'd otherwise be allowed to spend the htlc. If the cooperative musig2 spend fails, we always fall back to use the scriptpath spend.
This commit is contained in:
parent
32557a57ea
commit
82b58e5c0e
5 changed files with 553 additions and 108 deletions
|
|
@ -866,7 +866,9 @@ func (h *HtlcScriptV3) GenTimeoutWitness(
|
|||
// IsSuccessWitness checks whether the given stack is valid for
|
||||
// redeeming the htlc.
|
||||
func (h *HtlcScriptV3) IsSuccessWitness(witness wire.TxWitness) bool {
|
||||
return len(witness) == 4
|
||||
// The witness has four elements if this is a script spend or one
|
||||
// element if this is a keyspend.
|
||||
return len(witness) == 4 || len(witness) == 1
|
||||
}
|
||||
|
||||
// TimeoutScript returns the redeem script required to unlock the htlc after
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue