Skip to content

Commit b30100a

Browse files
committed
add comments
1 parent 1bc4fff commit b30100a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

node/sync.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ func (d *Pegnetd) SyncBlock(ctx context.Context, tx *sql.Tx, height uint32) erro
364364

365365
// 5) Apply Developers Rewards
366366
if height >= V20HeightActivation && height%pegnet.SnapshotRate == 0 {
367-
err := d.DevelopersPayouts(tx, fLog, height, dblock.Timestamp)
367+
err := d.DevelopersPayouts(tx, fLog, height, dblock.Timestamp, DeveloperRewardAddreses)
368368
if err != nil {
369369
// something wrong happend during payout execution
370370
return err
@@ -493,8 +493,9 @@ func (d *Pegnetd) SnapshotPayouts(tx *sql.Tx, fLog *log.Entry, rates map[fat2.PT
493493
return nil
494494
}
495495

496-
// DevelopersPayouts for PIP16 sending rewards for developers
497-
func (d *Pegnetd) DevelopersPayouts(tx *sql.Tx, fLog *log.Entry, height uint32, heightTimestamp time.Time) error {
496+
// Developers Reward Payouts
497+
// implementation of PIP16 - distributed rewards collected for developers every 24h
498+
func (d *Pegnetd) DevelopersPayouts(tx *sql.Tx, fLog *log.Entry, height uint32, heightTimestamp time.Time, developers []DevReward) error {
498499

499500
totalPayout := uint64(conversions.PerBlockDevelopers) * pegnet.SnapshotRate // once a day
500501
payoutStart := time.Now()
@@ -504,7 +505,7 @@ func (d *Pegnetd) DevelopersPayouts(tx *sql.Tx, fLog *log.Entry, height uint32,
504505

505506
// we use hardcoded list of dev payouts
506507
i := 0
507-
for _, dev := range DeveloperRewardAddreses {
508+
for _, dev := range developers {
508509

509510
// we calculate developers reward from % pre-defined
510511
rewardPayout := uint64((conversions.PerBlockDevelopers / 100) * dev.DevRewardPct)

0 commit comments

Comments
 (0)