summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/BandwidthAccount.hpp9
-rw-r--r--node/Network.hpp3
2 files changed, 12 insertions, 0 deletions
diff --git a/node/BandwidthAccount.hpp b/node/BandwidthAccount.hpp
index e8fc51d4..be180cfc 100644
--- a/node/BandwidthAccount.hpp
+++ b/node/BandwidthAccount.hpp
@@ -121,6 +121,15 @@ public:
return false;
}
+ /**
+ * @return Most recent balance without update
+ */
+ inline uint32_t balance() const
+ throw()
+ {
+ return _balance;
+ }
+
private:
double _lastTime;
uint32_t _balance;
diff --git a/node/Network.hpp b/node/Network.hpp
index a269ec18..ec4b9299 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -581,6 +581,9 @@ public:
bal = _multicastRateAccounts.insert(std::pair< std::pair<Address,MulticastGroup>,BandwidthAccount >(k,BandwidthAccount(r.preload,r.maxBalance,r.accrual))).first;
}
return bal->second.deduct(bytes);
+ //bool tmp = bal->second.deduct(bytes);
+ //printf("%s: BAL: %u\n",mg.toString().c_str(),(unsigned int)bal->second.balance());
+ //return tmp;
}
private: