mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Rework block rewards to be faster and only reward *online* founders.
Now we sum generic block reward + transaction fees before performing distribution only once. Added Map to collate account-balance changes during block reward distribution so the final changes can be applied in one batch, reducing DB load. Some other optimizations like a faster ExpandedAccount.getShareBin(). Passes test EXCEPT RewardTests.testLegacyQoraReward(), pending decision on how to reallocate 'unspent' block reward.
This commit is contained in:
@@ -241,15 +241,15 @@ public class RewardTests extends Common {
|
||||
|
||||
BlockMinter.mintTestingBlock(repository, mintingAndOnlineAccounts.toArray(new PrivateKeyAccount[0]));
|
||||
|
||||
// 3 founders (online or not) so blockReward divided by 3
|
||||
int founderCount = 3;
|
||||
// 2 founders online so blockReward divided by 2
|
||||
int founderCount = 2;
|
||||
long perFounderReward = blockReward / founderCount;
|
||||
|
||||
// Alice simple self-share so her reward is perFounderReward
|
||||
AccountUtils.assertBalance(repository, "alice", Asset.QORT, perFounderReward);
|
||||
|
||||
// Bob not online so his reward is simply perFounderReward
|
||||
AccountUtils.assertBalance(repository, "bob", Asset.QORT, perFounderReward);
|
||||
// Bob not online so his reward is zero
|
||||
AccountUtils.assertBalance(repository, "bob", Asset.QORT, 0L);
|
||||
|
||||
// Chloe has two reward-shares, so her reward is divided by 2
|
||||
int chloeSharesCount = 2;
|
||||
|
Reference in New Issue
Block a user