I needed this for the 'smartfee' work I'm doing; I made it a CTransaction method in core.cpp, though:

```
/** Amount of bitcoins spent by the transaction.
    @return sum of all outputs (note: does not include fees)
 */
int64 CTransaction::GetValueOut() const
{
    int64 nValueOut = 0;
    BOOST_FOREACH(const CTxOut& txout, this->vout)
    {
        nValueOut += txout.nValue;
        if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))
            throw std::runtime_error("GetValueOut() : value out of range");
    }
    return nValueOut;
}
```