MattyIce / postpromoter

Steem bid-based voting bot written in JavaScript
MIT License
45 stars 89 forks source link

Bot refunding All Users on First Start #68

Open spiftheninja opened 6 years ago

spiftheninja commented 6 years ago

Maybe this has been addressed somewhere, but I couldn't find it.

Upon first starting the bot (first time), it will automatically refund all accounts in the transaction history which do not represent a 'valid bid'. This caused me a large headache as it sent out all my SBD to completely unrelated accounts.

Is there a way around this already?

I propose an option to 'skip refunds' except for those on the current or first round, or to have only bot look for transactions that happened within the X time period.

The bot was refunding users who had paid me days ago, up to a week!

This could be easily fixed with a minor tweak which would make sure it only refunds users who have paid during the current round, or within X given time frame.

Thanks for checking into this, hope it helps.

MattyIce commented 6 years ago

@spiftheninja if the bot software is run for the very first time it does not process any transactions on the account from before it started. If the bot has been run before and then is stopped and started again later - then when it starts again later it will pick up all transactions since the last time it was stopped. My guess is this is what happened in your case.

I agree that it would be a good improvement to limit how many transactions it will process in this scenario and will add that to my development list. In the meantime you can delete the state.json file if you are restarting the bot after it has been stopped for a long time to prevent it from processing old transactions.

chhantyal commented 6 years ago

I sent a PR to fix this #73

I think just deleting state.json will cause another issue. If there are outstanding bids, bot will ignore them.