<blockquote>
  <p>But what the GetValueOut() calculate - all vout for a Tx?</p>
</blockquote>

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

CC BY-SA 4.0
2018-09-20T20:02:49.743Z
JBaczuk, thank you so much for all your help.
yrm23
CC BY-SA 4.0
2018-09-20T19:25:20.203Z
2018-09-20T19:25:20.203Z
JBaczuk
<p>In Transaction.cpp, there is a function CAmount CTransaction::GetValueOut() const. 
In Coins.cpp, there is a function CAmount CCoinsViewCache::GetValueIn(const CTransaction&amp; tx) const. 
My understand the GetValueIn() is calculater all vin value for a Tx.
But what the GetValueOut() calculate - all vout for a Tx?</p>

<transactions><utxo><transaction-input>
Which values are GetValueIn() and GetValueOut() calculate?
yrm23
# Which values are GetValueIn() and GetValueOut() calculate?

(Asked by: username_0 on 2018-09-20)

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?

**Tags:** transactions, utxo, transaction-input


---

## 1 answers

### Answer by username_1 on 2018-09-20. Score: 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).

> **Comments:**
> **username_0**: username_1, thank you so much for all your help.  

---

