HCP
Legendary
Offline
Activity: 2086
Merit: 4316
<insert witty quote here>
|
|
December 15, 2018, 06:57:03 PM |
|
I think it may be because you have called transaction.to() twice?
Each time you do this, I believe you are creating a new output... so I suspect you have ONE UTXO (input)... but have then created TWO outputs...
transaction.to(main_wallet, max);
and then
transaction.to(main_wallet, max-finalFee);
This is also the most likely reason why the sum of your outputs is a little under twice the input... 39962 * 2 = 79924... your outputs sum to 78904, because of the "-finalFee" (ie. it has subtracted a fee of 1020).
|