mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2026-02-21 06:24:26 +01:00
walletrpc: extract leases marshall function
This commit is contained in:
@@ -1078,6 +1078,17 @@ func (w *WalletKit) FundPsbt(_ context.Context,
|
||||
}
|
||||
|
||||
// Convert the lock leases to the RPC format.
|
||||
rpcLocks := marshallLeases(locks)
|
||||
|
||||
return &FundPsbtResponse{
|
||||
FundedPsbt: rawPsbt.Bytes(),
|
||||
ChangeOutputIndex: changeIndex,
|
||||
LockedUtxos: rpcLocks,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// marshallLeases converts the lock leases to the RPC format.
|
||||
func marshallLeases(locks []*wtxmgr.LockedOutput) []*UtxoLease {
|
||||
rpcLocks := make([]*UtxoLease, len(locks))
|
||||
for idx, lock := range locks {
|
||||
rpcLocks[idx] = &UtxoLease{
|
||||
@@ -1091,11 +1102,7 @@ func (w *WalletKit) FundPsbt(_ context.Context,
|
||||
}
|
||||
}
|
||||
|
||||
return &FundPsbtResponse{
|
||||
FundedPsbt: rawPsbt.Bytes(),
|
||||
ChangeOutputIndex: changeIndex,
|
||||
LockedUtxos: rpcLocks,
|
||||
}, nil
|
||||
return rpcLocks
|
||||
}
|
||||
|
||||
// FinalizePsbt expects a partial transaction with all inputs and outputs fully
|
||||
|
||||
Reference in New Issue
Block a user