mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Refactor: move GetValueIn(tx) to tx.GetValueIn()
GetValueIn makes more sense as a CTransaction member.
This commit is contained in:
parent
98c7c8fd1d
commit
0733c1bde6
10 changed files with 33 additions and 36 deletions
12
src/core.cpp
12
src/core.cpp
|
|
@ -106,6 +106,18 @@ bool CTransaction::IsNewerThan(const CTransaction& old) const
|
|||
return fNewer;
|
||||
}
|
||||
|
||||
int64_t CTransaction::GetValueOut() const
|
||||
{
|
||||
int64_t nValueOut = 0;
|
||||
BOOST_FOREACH(const CTxOut& txout, vout)
|
||||
{
|
||||
nValueOut += txout.nValue;
|
||||
if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))
|
||||
throw std::runtime_error("CTransaction::GetValueOut() : value out of range");
|
||||
}
|
||||
return nValueOut;
|
||||
}
|
||||
|
||||
std::string CTransaction::ToString() const
|
||||
{
|
||||
std::string str;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue