Bitcoin Forum
May 11, 2024, 07:40:40 PM *
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 144 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
1715456441
Hero Member
*
Offline Offline

Posts: 1715456441

View Profile Personal Message (Offline)

Ignore
1715456441
Reply with quote  #2

1715456441
Report to moderator
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715456441
Hero Member
*
Offline Offline

Posts: 1715456441

View Profile Personal Message (Offline)

Ignore
1715456441
Reply with quote  #2

1715456441
Report to moderator
1715456441
Hero Member
*
Offline Offline

Posts: 1715456441

View Profile Personal Message (Offline)

Ignore
1715456441
Reply with quote  #2

1715456441
Report to moderator
1715456441
Hero Member
*
Offline Offline

Posts: 1715456441

View Profile Personal Message (Offline)

Ignore
1715456441
Reply with quote  #2

1715456441
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!