From 3ab30ad6d851fc9ef4d5a1fb3ed5bb1c5f56f519 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 18 Oct 2018 14:28:48 +0100 Subject: [PATCH] Change interest rates to use wallets --- modules/coins.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/coins.py b/modules/coins.py index 247182ce..a9204295 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -464,8 +464,12 @@ class Module(ModuleManager.BaseModule): if coins > redeem_amount: interest = round(coins*interest_rate, 2) self._take_from_pool(server, interest) - server.set_user_setting(nickname, "coins", - self._coin_str(coins+interest)) + + wallets = server.get_user_setting(nickname, "wallets", {}) + default_coins = wallets.get("default", "0.0") + default_coins = decimal.Decimal(default_coins) + wallets["default"] = self._coin_str(default_coins+interest) + server.set_user_setting(nickname, "wallets", wallets) event["timer"].redo() @utils.hook("received.command.lotterybuy", authenticated=True)