projectpai / paicoin

Official repo of PAI Coin
https://projectpai.com
MIT License
63 stars 35 forks source link

Add support for expiring tickets and set the default to 144 for the auto buyer #341

Closed pgerzani closed 3 years ago

pgerzani commented 3 years ago

In the Decred implementation, when you purchase a ticket you can specify an expiration. This prevents the issue we are seeing with our mempool filling up with tickets that aren't being included in blocks. I see in our own implementation of purchaseticket we have an expiry option, however tracing the code I don't see where that is used (I may have overlooked it though).

So, please:

  1. Make sure that the expiry is used as intended on the ticket purchase tx. The ticket funding tx is a regular transaction so it isn't an issue with expiry.
  2. Change it so the auto ticket buyer expires tickets after 144 blocks by default. We can make this a new option for paicoind and lets have the range be 10-1000 for now.
sebastianrusu commented 3 years ago

This has been implemented in https://github.com/projectpai/paicoin/pull/357.