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

Ensure fees are treated correctly in relation to mining. #27

Open
r3rcloak opened this issue Jan 26, 2019 · 2 comments
Open

Ensure fees are treated correctly in relation to mining. #27

r3rcloak opened this issue Jan 26, 2019 · 2 comments
Assignees
Labels
investigation Investigate a problem or new feature Sync/Consensus Issues related to block syncing / network consensus rules

Comments

@r3rcloak
Copy link
Collaborator

Bitcoin assigns tx fees to miners as part of the mining process. Peercoin (and likely Cloak) seem to treat fees differently. This should be investigated and mirrored (if necessary) in the new codebase.

@r3rcloak r3rcloak added the investigation Investigate a problem or new feature label Jan 26, 2019
@r3rcloak r3rcloak added this to the PoW/PoS Mining Implemented milestone Jan 26, 2019
@r3rcloak r3rcloak self-assigned this Jan 26, 2019
@r3rcloak
Copy link
Collaborator Author

main.cpp ~ln 1635:

// ppcoin: fees are not collected by miners as in bitcoin
// ppcoin: fees are destroyed to compensate the entire network

@r3rcloak
Copy link
Collaborator Author

Having looked at the code, it looks like fees are handled as per Bitcoin for any tx that is not a coinbase or coinstake tx.

GetProofOfWorkReward takes 'nFees' as an argument and then adds this to the returned subsidy (block reward) amount.

We can see in CreateNewBlock, that fees are indeed included in the block reward for PoW blocks as standard. See ~ln 4497 in main.cpp for the code:

if (pblock->IsProofOfWork())
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pindexPrev->nHeight+1, nFees, pindexPrev->GetBlockHash());

@r3rcloak r3rcloak added the Sync/Consensus Issues related to block syncing / network consensus rules label May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation Investigate a problem or new feature Sync/Consensus Issues related to block syncing / network consensus rules
Projects
None yet
Development

No branches or pull requests

1 participant