You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wallet generates new coinbases for mines when asked. This is done on the height and amount.
What the wallet does is when it is asked for a new coinbase it searches the db for a coinbase tx for that height and amount. If a match is found, that is returned. If a match is not found, it creates a new tx for that height and amount. But it also delete's all other coinbases for that height.
This is a problem as some miner might still be mining that coinbase tx. The wallet should not just right of the bat delete all other coinbases.
The other problem is that the miner generates an offset_private key out of random each time. This should be changed to a derived key(might use the current coinbase_pvt key) so that it is the same.
It could happen if two miners ask for a new coinbase very close to each other that the wallet generates two coinbases only keeps one. Then the miner who won the block has its coinbases deleted, but the wallet thinks it has it due to the fact that the commitment matches.
The text was updated successfully, but these errors were encountered:
Description
---
The current coinbase handling relies on height and amount. If a match is not found for that height and amount, then it creates a new tx, deleting all the existing coinbases for that height. This is a problem, as miners can be working concurrently on a (to-be deleted) coinbase. This PR addresses this issue (see #4353).
Motivation and Context
---
Fixes#4353.
How Has This Been Tested?
---
Unit and cucumber tests
The wallet generates new coinbases for mines when asked. This is done on the height and amount.
What the wallet does is when it is asked for a new coinbase it searches the db for a coinbase tx for that height and amount. If a match is found, that is returned. If a match is not found, it creates a new tx for that height and amount. But it also delete's all other coinbases for that height.
This is a problem as some miner might still be mining that coinbase tx. The wallet should not just right of the bat delete all other coinbases.
The other problem is that the miner generates an offset_private key out of random each time. This should be changed to a derived key(might use the current coinbase_pvt key) so that it is the same.
It could happen if two miners ask for a new coinbase very close to each other that the wallet generates two coinbases only keeps one. Then the miner who won the block has its coinbases deleted, but the wallet thinks it has it due to the fact that the commitment matches.
The text was updated successfully, but these errors were encountered: