Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

jgarzik
Copy link
Contributor

@jgarzik jgarzik commented Sep 4, 2013

Suggested by gmaxwell.

return total;
}

static int64 txOutputTotal(const CTransaction& tx)
Copy link
Contributor

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;
}

@jgarzik
Copy link
Contributor Author

jgarzik commented Sep 9, 2013

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

@laanwj laanwj added RPC labels May 9, 2014
@jgarzik
Copy link
Contributor Author

jgarzik commented May 20, 2014

Rebased... though the current IRC consensus seems to lean towards another RPC 'buildrawtransaction' which has fee and coin selection smarts.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/be96bf0a577faf928376e62840cd1ea33e5fbd16 for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@jgarzik
Copy link
Contributor Author

jgarzik commented Jun 6, 2014

Closing. A good idea, but buggy, and should be superceded by 'buildrawtransaction' which is smarter about fees and coin selection in general.

@jgarzik jgarzik closed this Jun 6, 2014
@jgarzik jgarzik deleted the crt-fee-safety branch August 24, 2014 04:20
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Apr 8, 2020
* Implement GetAddressInfo in CAddrMan

* Back off for 1m when connecting to quorum masternodes
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Apr 8, 2020
* Implement GetAddressInfo in CAddrMan

* Back off for 1m when connecting to quorum masternodes
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants