Bitcoin Forum
April 25, 2024, 05:25:52 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Error validating Transaction. Sum of inputs lesser than outputs  (Read 141 times)
LRZ (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 13, 2018, 11:55:44 PM
 #1

Hi I was wondering if someone could help me out with some code.
I'm trying to create a HD wallet for a user to deposit into, and then move that money to a main wallet once that deposit has been confirmed.
I'm having a little trouble. Quite new to blockchain dev and and how it all works.

Any help would be greatly appreciated.

https://stackoverflow.com/questions/53771644/error-validating-transaction-sum-of-inputs-lesser-than-outputs-bitcore
1714022752
Hero Member
*
Offline Offline

Posts: 1714022752

View Profile Personal Message (Offline)

Ignore
1714022752
Reply with quote  #2

1714022752
Report to moderator
1714022752
Hero Member
*
Offline Offline

Posts: 1714022752

View Profile Personal Message (Offline)

Ignore
1714022752
Reply with quote  #2

1714022752
Report to moderator
1714022752
Hero Member
*
Offline Offline

Posts: 1714022752

View Profile Personal Message (Offline)

Ignore
1714022752
Reply with quote  #2

1714022752
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714022752
Hero Member
*
Offline Offline

Posts: 1714022752

View Profile Personal Message (Offline)

Ignore
1714022752
Reply with quote  #2

1714022752
Report to moderator
1714022752
Hero Member
*
Offline Offline

Posts: 1714022752

View Profile Personal Message (Offline)

Ignore
1714022752
Reply with quote  #2

1714022752
Report to moderator
1714022752
Hero Member
*
Offline Offline

Posts: 1714022752

View Profile Personal Message (Offline)

Ignore
1714022752
Reply with quote  #2

1714022752
Report to moderator
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 15, 2018, 06:57:03 PM
 #2

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).

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!