mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 05:08:13 +02:00
multi: fix inclusion proof size
The inclusion proof field in the TapscriptPartialReveal function was incorrect. An inclusion proof can be zero or more elements of 32-byte slices. So an empty inclusion proof can be valid too for a tree that only consists of a single leaf.
This commit is contained in:
@@ -75,12 +75,12 @@ func TapscriptFullTree(internalKey *btcec.PublicKey,
|
||||
// key and revealed script.
|
||||
func TapscriptPartialReveal(internalKey *btcec.PublicKey,
|
||||
revealedLeaf txscript.TapLeaf,
|
||||
inclusionProof [32]byte) *waddrmgr.Tapscript {
|
||||
inclusionProof []byte) *waddrmgr.Tapscript {
|
||||
|
||||
controlBlock := &txscript.ControlBlock{
|
||||
InternalKey: internalKey,
|
||||
LeafVersion: txscript.BaseLeafVersion,
|
||||
InclusionProof: inclusionProof[:],
|
||||
InclusionProof: inclusionProof,
|
||||
}
|
||||
rootHash := controlBlock.RootHash(revealedLeaf.Script)
|
||||
tapKey := txscript.ComputeTaprootOutputKey(internalKey, rootHash)
|
||||
|
Reference in New Issue
Block a user