mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 17:47:01 +02:00
lnwallet: for PsbtIntent return the internal key in the POutput
We also add a new assertion to the itests to ensure the field is being properly set.
This commit is contained in:
committed by
Oliver Gugger
parent
7144a1c733
commit
bed4562584
@@ -6,11 +6,13 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/btcsuite/btcd/btcec/v2/schnorr"
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/btcutil/psbt"
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
)
|
||||
@@ -208,7 +210,18 @@ func (i *PsbtIntent) FundingParams() (btcutil.Address, int64, *psbt.Packet,
|
||||
}
|
||||
}
|
||||
packet.UnsignedTx.TxOut = append(packet.UnsignedTx.TxOut, out)
|
||||
packet.Outputs = append(packet.Outputs, psbt.POutput{})
|
||||
|
||||
var pOut psbt.POutput
|
||||
|
||||
// If this is a MuSig2 channel, we also need to communicate the internal
|
||||
// key to the caller. Otherwise, they cannot verify the construction of
|
||||
// the P2TR output script.
|
||||
pOut.TaprootInternalKey = fn.MapOptionZ(
|
||||
i.TaprootInternalKey(), schnorr.SerializePubKey,
|
||||
)
|
||||
|
||||
packet.Outputs = append(packet.Outputs, pOut)
|
||||
|
||||
return addr, out.Value, packet, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user