0
In our application we are generating a trasaction hex using the createrawtransaction call to "handcraft" a transaction. The problem we are facing is that we would like to estimate the mining fee for this transaction. I realize that we could call estimatefee x to estimate the mining fee per byte. But the problem is we are generating the transaction, so we don't know the size of the transaction yet! Chicken or egg?! I realize that we can generate a transaction and then account for the mining fee based on the hex, but this sounds like a hack to me.
So the question is: what's the best way to estimate the optimal mining fee while using createrawtransaction ?
This is a great suggestion! But we want to spend from a particular address in the wallet which we retrieve from
listunspent.. so it won't work for us as there is no way to do this filtering infundrawtransaction– motatoes – 2017-02-07T10:21:34.607In that case you need to calculate the transaction size by yourself by assume 72byte per EC sig. But it depends what types of inputs you support (P2PKH, etc.). – Jonas Schnelli – 2017-02-07T19:40:16.447
Well they are all multisig addresses .. So P2SH – motatoes – 2017-02-07T21:05:34.373