Post
Topic
Board Bitcoin Technical Support
Re: How to avoid negative account balance due to fee?
by
bananas
on 07/03/2014, 04:15:52 UTC
Actually, there is a way to calculate the length of the transaction before sending it:

Code:
10 + (148 * I) + (34 * O) + I

Where I is the number of inputs, O is the number of outputs in the transaction. This assumes that all inputs are spending normal "pay to address" outputs, and all the outputs are normal "pay to address" outputs as well.

How do i know the number of inputs ?