Skip to content

Commit

Permalink
optimze
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommo-L committed Aug 21, 2020
1 parent 4d119db commit e3a5b15
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/neo/SmartContract/Native/Tokens/NeoToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,12 @@ protected override void OnPersist(ApplicationEngine engine)

// Distribute GAS for committee

var committee = GetCommittee(engine.Snapshot);
var gasPerBlock = GetGasPerBlock(engine.Snapshot);
var amount = gasPerBlock * CommitteeRewardRatio / 100 / committee.Length;
foreach (var member in committee)
{
var account = Contract.CreateSignatureContract(member).ScriptHash;
GAS.Mint(engine, account, amount);
}
var index = engine.Snapshot.PersistingBlock.Index;
var committee = GetCommittee(engine.Snapshot);
var member = committee[index % ProtocolSettings.Default.CommitteeMembersCount];
var account = Contract.CreateSignatureContract(member).ScriptHash;
GAS.Mint(engine, account, gasPerBlock * CommitteeRewardRatio / 100);

// Set next validators

Expand Down

0 comments on commit e3a5b15

Please sign in to comment.