-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPC: createrawtransactions gains 'fee' pseudo-address for fee safety #2975
Conversation
return total; | ||
} | ||
|
||
static int64 txOutputTotal(const CTransaction& tx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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;
}
Note that @gmaxwell was unable to get this PR to work for him, so there is a bug in there somewher. @gavinandresen CTransaction method works |
Rebased... though the current IRC consensus seems to lean towards another RPC 'buildrawtransaction' which has fee and coin selection smarts. |
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/be96bf0a577faf928376e62840cd1ea33e5fbd16 for binaries and test log. |
Closing. A good idea, but buggy, and should be superceded by 'buildrawtransaction' which is smarter about fees and coin selection in general. |
* Implement GetAddressInfo in CAddrMan * Back off for 1m when connecting to quorum masternodes
* Implement GetAddressInfo in CAddrMan * Back off for 1m when connecting to quorum masternodes
Suggested by gmaxwell.