Which values are GetValueIn() and GetValueOut() calculate?

0

In Transaction.cpp, there is a function CAmount CTransaction::GetValueOut() const. In Coins.cpp, there is a function CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const. My understand the GetValueIn() is calculater all vin value for a Tx. But what the GetValueOut() calculate - all vout for a Tx?

yrm23

Posted 2018-09-20T15:30:48.057

Reputation: 41

Answers

1

But what the GetValueOut() calculate - all vout for a Tx?

Yes, it calculates the total value of all the outputs in the transaction. It also makes sure that the value is not out of range of the total supply of Bitcoin (21M).

JBaczuk

Posted 2018-09-20T15:30:48.057

Reputation: 6 172

JBaczuk, thank you so much for all your help.yrm23 2018-09-20T20:02:49.743