biblepay / biblepay_legacy

BiblePay
MIT License
35 stars 34 forks source link

enhance: auto tithe picks optimal balance with least min coin age and least min coin value to tithe #84

Closed fogoat closed 5 years ago

fogoat commented 5 years ago

I'd like to request an auto tithe where the least min coin age and least min coin value input is used when auto tithing.

https://viisastentori.fi/bbp_test/index.php has a tool gives some visibility to how much coin you need to participate on any given block. Seems like 5k-6k BBP would let you participate often. 9k-10k if you always wanted to participate... assuming you had enough min coin age. Now, we also have to see how auto tithe works and better it chooses coins optimally or randomly. If you have a 10k BBP balance, but 5k BBP would work just as well, would 10k BBP would be picked in some instances of auto-tithe?

biblepay commented 5 years ago

Yeah, this sounds like a good idea that we need relatively quick, as I can see people getting upset they did a lot of work to age the coins and then we spend them in the wrong order as soon as difficulty drops...

I modified our createtransaction to have the ability to spend a specific coin. We have a function called SelectCoinForTithing that will now select the coin with the least age that meets the diff level. We can pass this coin into CreateTransaction.

Another words, the wallet will always tithe the coin with the least coin age for a given diff level.

biblepay commented 5 years ago

After testing it prod it appears this is working.

fogoat commented 5 years ago

Feature in 1196: https://github.com/biblepay/biblepay/commit/6d4a30742281fed1b513a00299009bf39c039cc9

Activated in 1198: https://github.com/biblepay/biblepay/commit/eae263d6c6ac16f0bfb3100f994d040918c90f68