Createrawtransaction questions

1

I'm in the process of assembling raw transactions and I have a couple of questions.

I'm using listunspent to get a list of the transactions I can spend....

First, should I select the oldest transaction first for inclusion? Or is there a better way to select transactions?

Second, for calculating the transaction fee, is there an easy way to estimate the size of a transaction? For example, can I say each output is X bytes and each input is Y bytes?

user789235

Posted 2014-01-08T16:01:25.503

Reputation: 126

Answers

1

You don't have to select the oldest transactions, they are same as the recent transactions in blockchain's utxo view. When building a transaction, you can take the transaction size into consideration, which could affect the transaction fee.

Generally, each output is 148bytes and each input is 34bytes. Here is a more accurate way to calculate transaction fee.

How to calculate transaction size before sending

Peili Liang

Posted 2014-01-08T16:01:25.503

Reputation: 78