Skip to content

Conversation

forrestv
Copy link
Contributor

Having the fee data for every transaction returned by "getblocktemplate" was broken by the ultraprune commit (450cbb0). It made it so transactions that depend on other transactions in the block-to-be don't have fee data.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/d42d932bed6b564cbfc00216d1c04cd5248ddeef for binaries and test log.

entry.push_back(Pair("fee", (int64_t)(tx.GetValueIn(view) - tx.GetValueOut())));
nSigOps += tx.GetP2SHSigOpCount(view);
}
assert(tx.HaveInputs(view));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the possibility of bitcoind just aborting. Is there some reason not to make this an if() block as a failsafe?

@sipa
Copy link
Member

sipa commented Dec 19, 2012

I think it would be better to have CreateNewBlock construct some meta-data object with fees in it, which can be used by getblocktemplate.

EDIT: this definitely needs fixing of course, but it seems silly to have GBT redo the fee calculation in an incomplete way, when CreateNewBlock perfectly knows all fees.

@luke-jr
Copy link
Member

luke-jr commented Dec 19, 2012

No reason it can't be optimized after merging this fix, IMO.

@forrestv
Copy link
Contributor Author

/me is working on having CreateNewBlock return fee data in addition

@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/3a291f97f0dc1c98f980a3f5679000339416961f for binaries and test log.

This could happen for one of several reasons:

  1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts
  2. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
  3. The test suite fails on either Linux i386 or Win32
  4. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

@forrestv
Copy link
Contributor Author

Okay, CreateNewBlock now returns a CBlockTemplate struct that contains the block and fee and sigop data.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/0f927ceb5b90ec02be36ddb20b2f4cff82589265 for binaries and test log.

@sipa
Copy link
Member

sipa commented Dec 20, 2012

Code looks good to me. I'll do some testing soon.

@sipa
Copy link
Member

sipa commented Jan 4, 2013

ACK

@gmaxwell
Copy link
Contributor

gmaxwell commented Jan 4, 2013

Been running this for almost two weeks on a node. Did basic sanity checks. ACK.

@jgarzik
Copy link
Contributor

jgarzik commented Jan 4, 2013

ACK

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/f3d872d1eabeb5c999162f709626ee20c8789c42 for binaries and test log.

sipa added a commit that referenced this pull request Jan 10, 2013
Provide fee data for all txs in RPC getblocktemplate response
@sipa sipa merged commit 45a1ec5 into bitcoin:master Jan 10, 2013
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
Provide fee data for all txs in RPC getblocktemplate response
@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants