Peershares/Peershares — pull request #30 by sigmike (2014-02-16 17:25:33+00:00)
Title: Distribution class

Here are the `Distribution` and `DividendDistributor` classes for issues #21, #22 (I guess) and #25.

I wrote unit tests for that: https://github.com/sigmike/Peershares/blob/711fcb9b723b8f255141a1080db80458d0570e58/src/test/distribution_tests.cpp
I had to disable an old test that failed to build.

The transaction fee is fixed to 0.01 PPC per address (so one transaction per address). We can reduce this fee but it's a complex task, so maybe we can start like that. I'll write another issue with details on how we can reduce the global fee and the problems it raises.

There are cases where the total distributed amount + fee do not equal to amount asked because of rounding. We can distribute the remaining part, but the distribution would not be fair, only some (almost random) addresses would get an extra amount.
Note that the smallest unit (i.e. where the rounding happens) is 0.000001 PPC so we probably don't care very much.