mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
staticaddr/withdraw: send per-deposit address proofs
Include the derivation key for every withdrawal input in the server request. This lets the server validate and sign withdrawals that combine deposits from multiple derived addresses.
This commit is contained in:
parent
b90c8fb386
commit
1b212fa105
1 changed files with 9 additions and 2 deletions
|
|
@ -561,6 +561,12 @@ func (m *Manager) CreateFinalizedWithdrawalTx(ctx context.Context,
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
depositClientPubkeys, err := staticutil.DepositClientPubkeys(deposits)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to prepare static address "+
|
||||
"input proofs: %w", err)
|
||||
}
|
||||
|
||||
withdrawalTx, unsignedPsbt, err := m.createWithdrawalTx(
|
||||
ctx, outpoints, deposits, prevOuts,
|
||||
btcutil.Amount(selectedWithdrawalAmount), withdrawalAddress,
|
||||
|
|
@ -579,8 +585,9 @@ func (m *Manager) CreateFinalizedWithdrawalTx(ctx context.Context,
|
|||
// nolint:lll
|
||||
sigResp, err := m.cfg.StaticAddressServerClient.ServerPsbtWithdrawDeposits(
|
||||
ctx, &staticaddressrpc.ServerPsbtWithdrawRequest{
|
||||
WithdrawalPsbt: unsignedPsbt,
|
||||
DepositToNonces: clientNonces,
|
||||
WithdrawalPsbt: unsignedPsbt,
|
||||
DepositToNonces: clientNonces,
|
||||
DepositToClientPubkeys: depositClientPubkeys,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue