From f052b14214b738c8e0941c7962ff5b89f4de940b Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Thu, 20 Feb 2014 17:29:13 +0200 Subject: [PATCH] added some comments --- engine/units_counter.go | 2 ++ engine/userbalance.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/units_counter.go b/engine/units_counter.go index 42742f6c9..372c70701 100644 --- a/engine/units_counter.go +++ b/engine/units_counter.go @@ -31,6 +31,8 @@ type UnitsCounter struct { Balances BalanceChain // first balance is the general one (no destination) } +// clears balances for this counter +// makes sure there are balances for all action triggers func (uc *UnitsCounter) initBalances(ats []*ActionTrigger) { uc.Balances = BalanceChain{&Balance{}} // general balance for _, at := range ats { diff --git a/engine/userbalance.go b/engine/userbalance.go index ce1c05a2d..cd207b623 100644 --- a/engine/userbalance.go +++ b/engine/userbalance.go @@ -374,7 +374,7 @@ func (ub *UserBalance) countUnits(a *Action) { ub.executeActionTriggers(nil) } -// Create minute counters for all triggered actions that have actions operating on minute buckets +// Create minute counters for all triggered actions that have actions opertating on balances func (ub *UserBalance) initCounters() { ucTempMap := make(map[string]*UnitsCounter, 2) for _, at := range ub.ActionTriggers {