Bitcoin-cli 0.19.1 Wallet not Sending from Addresses with Closest Amount? I have a weird issue that I thought was fixed a few years back with Bitcoin wallet to reduce fees. I guess not, or I am missing something...
My wallet received a transaction for the amount of 0.54530200 BTC, yet when I went and sent 0.51986042 BTC out using bitcoin-cli sendtomany to 16 outputs, the wallet used 856 inputs to send the amount that was available and cleared with at least 400+ confirmations in the first address.
The above TX cost me 0.03600705 BTC to send when it should have cost me a fraction of the amount had it used the address that contained the closest amount to the amount it's sending out...
Bitcoint-cli version 0.19.1
Any ideas what I could be doing wrong or what I could be missing?
I am not sure why coin selection algorithm didn't work or if you manually added some inputs or could have manually added inputs to avoid this. However, you could have still avoided paying more fees.
The transaction had virtual size of 78213 VByte
You had used fee rate: 46 sat/vByte
Since this transaction involved lot of inputs and bigger size, you could have used a lower fee rate when mempool had less than 5 MB of transactions.
Assuming you had used 5 sat/vByte fee rate for this transaction, the total fees paid for the transaction would have been 0.0039 BTC which is 90% less than the fees you paid.
Looking at the mempool history, the transaction would have confirmed yesterday:

UTXO consolidation is normally done when mempool is clear or you have lots of time so that 1-5 sat/vByte can be used for such transactions.
Consolidation of 4 Million UTXOs at Xapo: https://bitcoinops.org/en/xapo-utxo-consolidation/