I am attempting to automate the process of sending coins from multiple transactions to a single output and single change address using createrawtransaction
I am a bit lost though, because how can I calculate the output amount to the change address without knowing the total size of the signed transaction to calculate the miners fee...
For instance
I have 3 input transactions, they total 0.1 BTC.
I have 1 output address that I want to send 0.05 BTC to.
I have 1 output change address that I want to send the rest of the BTC to.
How do I calculate the amount for the change address without knowing how much the miners fee will be?