Is your feature request related to a problem? Please describe.
In the context of creating a sophisticated wallet management application, a Bitcoin exchange wants to send unconfirmed funds that he knows are safe because they are from an external wallet under its control. It is crucial that this these transactions be confirmed as soon as possible. Not being able to spend the unconfirmed funds effectively doubles the transaction time.
The developpers of this wallet management solution are using the Bitcoin Core RPC. They would prefer to continue relaying on Bitcoin Core to create the transaction and fund it with the coinselection of Bitcoin Core. As such, they want to keep using the "sendtoaddress" RPC.
However, it would appear that Bitcoin Core considers unconfirmed outputs that are from an external wallet as not "safe" and does not include them in the coin selection when using the "sendtoaddress" and "fundrawtransaction" RPC.
I believe that this is a well-intended policy to protect some users from themselves, and that it assumes that advanced users will be able to bypass it by using "createrawtransaction". However, the degree of complexity of using "createrawtransaction" is significantly higher than "sendtoaddress" and can actually make it more likely to do a mistake. In addition, using the wallet RPC already denotes some degree of sophistication.
A few wallets, for example Electrum, allows users to spend unconfirmed funds. This has been useful personally for me on many occasion. However, when building applications, one cannot rely on such wallets and it is always preferable to use Bitcoin Core wallet itself, in my opinion.
I think a good compromise would be to have a configuration (.conf) that allows unconfirmed outputs to be included in the "sendtoaddress" and "fundrawtransaction" RPC calls.
Describe the solution you'd like
A configuration that allow unconfirmed outputs to be included in the "sendtoaddress" and "fundrawtransaction" RPC calls.
Another option would be to add a boolean flag (default=false) like "allow_unconfirmed" in the RPC on a per-call basis.
Describe alternatives you've considered Using createrawtransaction
References
\"safe\" : xxx (bool) Whether this output is considered safe to spend. Unconfirmed transactions from outside keys and unconfirmed replacement transactions are considered unsafe and are not eligible for spending by fundrawtransaction and sendtoaddress.