mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 02:02:10 +02:00
multi: upgrade new taproot TLVs to use tlv.OptionalRecordT
In this commit, we update new Taproot related TLVs (nonces, partial sig, sig with nonce, etc). Along the way we were able to get rid of some boiler plate, but most importantly, we're able to better protect against API misuse (using a nonce that isn't initialized, etc) with the new options API. In some areas this introduces a bit of extra boiler plate, and where applicable I used some new helper functions to help cut down on the noise. Note to reviewers: this is done as a single commit, as changing the API breaks all callers, so if we want things to compile it needs to be in a wumbo commit.
This commit is contained in:
@@ -50,9 +50,9 @@ type ClosingComplete struct {
|
||||
// decodeClosingSigs decodes the closing sig TLV records in the passed
|
||||
// ExtraOpaqueData.
|
||||
func decodeClosingSigs(c *ClosingSigs, tlvRecords ExtraOpaqueData) error {
|
||||
sig1 := tlv.ZeroRecordT[tlv.TlvType1, Sig]()
|
||||
sig2 := tlv.ZeroRecordT[tlv.TlvType2, Sig]()
|
||||
sig3 := tlv.ZeroRecordT[tlv.TlvType3, Sig]()
|
||||
sig1 := c.CloserNoClosee.Zero()
|
||||
sig2 := c.NoCloserClosee.Zero()
|
||||
sig3 := c.CloserAndClosee.Zero()
|
||||
|
||||
typeMap, err := tlvRecords.ExtractRecords(&sig1, &sig2, &sig3)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user