diff --git a/lnrpc/walletrpc/walletkit_server.go b/lnrpc/walletrpc/walletkit_server.go index 6a1b8d116..d3f5131b0 100644 --- a/lnrpc/walletrpc/walletkit_server.go +++ b/lnrpc/walletrpc/walletkit_server.go @@ -1574,12 +1574,12 @@ func (w *WalletKit) fundPsbtInternalWallet(account string, return true } - eligible := fn.Filter(filterFn, utxos) + eligibleUtxos := fn.Filter(filterFn, utxos) // Validate all inputs against our known list of UTXOs // now. err = verifyInputsUnspent( - packet.UnsignedTx.TxIn, eligible, + packet.UnsignedTx.TxIn, eligibleUtxos, ) if err != nil { return err diff --git a/rpcserver.go b/rpcserver.go index 7f2ca16da..810ac2630 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1890,7 +1890,7 @@ func newFundingShimAssembler(chanPointShim *lnrpc.ChanPointShim, initiator bool, // newFundingShimAssembler returns a new fully populated // chanfunding.PsbtAssembler using a FundingShim obtained from an RPC caller. -func newPsbtAssembler(req *lnrpc.OpenChannelRequest, normalizedMinConfs int32, +func newPsbtAssembler(req *lnrpc.OpenChannelRequest, psbtShim *lnrpc.PsbtShim, netParams *chaincfg.Params) ( chanfunding.Assembler, error) { @@ -1904,11 +1904,6 @@ func newPsbtAssembler(req *lnrpc.OpenChannelRequest, normalizedMinConfs int32, if len(psbtShim.PendingChanId) != 32 { return nil, fmt.Errorf("pending chan ID not set") } - if normalizedMinConfs != 1 { - return nil, fmt.Errorf("setting non-default values for " + - "minimum confirmation is not supported for PSBT " + - "funding") - } if req.SatPerByte != 0 || req.SatPerVbyte != 0 || req.TargetConf != 0 { // nolint:staticcheck return nil, fmt.Errorf("specifying fee estimation parameters " + "is not supported for PSBT funding") @@ -2351,8 +2346,12 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest, // chanfunding.PsbtAssembler to construct the funding // transaction. copy(req.PendingChanID[:], psbtShim.PendingChanId) + + // NOTE: For the PSBT case we do also allow unconfirmed + // utxos to fund the psbt transaction because we make + // sure we only use stable utxos. req.ChanFunder, err = newPsbtAssembler( - in, req.MinConfs, psbtShim, + in, psbtShim, &r.server.cc.Wallet.Cfg.NetParams, ) if err != nil {