Skip to content

Commit f141fce

Browse files
gijswijsguggero
authored andcommitted
tapsend+asset: validate with altleaves from proof
Instead of using alt leaves from the inputs, we use the alt leaves from the proof. We also remove the deduplication func `AddLeafKeysVerifyMerge` because it's not needed anymore.
1 parent 91690b7 commit f141fce

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tapsend/send.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,6 +2009,19 @@ func ValidateAnchorInputs(anchorPacket *psbt.Packet, packets []*tappsbt.VPacket,
20092009
inputSiblings[outpoint] = sibling
20102010
inputScripts[outpoint] = anchorIn.WitnessUtxo.PkScript
20112011
inputAnchors[outpoint] = vIn.Anchor
2012+
2013+
// AltLeaves are the same for all assets from the same
2014+
// outpoint. So we only need to store them once for each
2015+
// outpoint.
2016+
if vIn.Proof == nil {
2017+
continue
2018+
}
2019+
2020+
if _, ok := inputAltLeaves[outpoint]; !ok {
2021+
inputAltLeaves[outpoint] = asset.CopyAltLeaves(
2022+
vIn.Proof.AltLeaves,
2023+
)
2024+
}
20122025
}
20132026
}
20142027

0 commit comments

Comments
 (0)