0/2 discussions resolved
- Developer
Need to do some testing, and run this by somebody. Not 100% sure I've properly filtered down the transactions as the number coming out is not quite what I'd expect (though is close). Could be related to ES running under low disk constraints.
- Last updated by Mark Harding
98 98 if ($balance->add($this->amount)->lt(0)) { 99 99 throw new \Exception('Not enough funds'); 100 100 } 101 101 if ($this->countOffchainBoosts(time() - (60*60*24), time()) > 10) { - Owner
Boost logic should be inside of boost, not inside of the payment system
- Owner
You should have seen that we are doing something similar to prevent the same boost being made before review, solution should be similar.
274 277 return (string) BigNumber::toPlain($value, 18); 275 278 } 276 279 280 /** 281 * Counts the amount of offchain boosts for the user. 282 * 283 * @param integer from - unix timestamp 'from' time. 284 * @param integer to - unix timestamp 'to' time. 285 * @return integer the amount of offchain boosts. 286 */ 287 private function countOffchainBoosts($from, $to) { 288 $repo = Di::_()->get('Blockchain\Transactions\Repository'); - Owner
must be injected in constructor
added MR::Requires Changes label