Skip to content

Commit eec4438

Browse files
committed
make developer payouts only once a day
1 parent 01898ea commit eec4438

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

node/sync.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (d *Pegnetd) SyncBlock(ctx context.Context, tx *sql.Tx, height uint32) erro
301301
}
302302

303303
// 5) Apply Developers Rewards
304-
if height >= V20HeightActivation {
304+
if height >= V20HeightActivation && height%pegnet.SnapshotRate == 0 {
305305
err := d.DevelopersPayouts(tx, fLog, height, dblock.Timestamp)
306306
if err != nil {
307307
// something wrong happend during payout execution
@@ -437,7 +437,7 @@ func (d *Pegnetd) DevelopersPayouts(tx *sql.Tx, fLog *log.Entry, height uint32,
437437
totalPayout := uint64(conversions.PerBlockDevelopers) * pegnet.SnapshotRate // once a day
438438
payoutStart := time.Now()
439439

440-
// We need to mock a TXID to record zeroing
440+
// We need to mock a TXID to record dev rewards
441441
txid := fmt.Sprintf("%064d", height)
442442

443443
// we use hardcoded list of dev payouts
@@ -462,6 +462,7 @@ func (d *Pegnetd) DevelopersPayouts(tx *sql.Tx, fLog *log.Entry, height uint32,
462462
"error": err,
463463
"addr": dev.DevAddress,
464464
}).Info("error getting developer address")
465+
return err
465466
}
466467

467468
// ---- Database Payouts ----

0 commit comments

Comments
 (0)