From 046e8935dfc0ef355e88036c56d7fe186b2c5e20 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 22 Oct 2018 16:49:20 +0100 Subject: [PATCH] When deleting a wallet, shift funds to default 'in' wallet instead of assuming a user has a 'default' named wallet --- modules/coins.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/coins.py b/modules/coins.py index b146cf07..d272ee31 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -266,10 +266,11 @@ class Module(ModuleManager.BaseModule): (event["user"].nickname, wallet, default_type)) coins = self._get_user_coins(event["user"], wallet) - self._give(event["server"], event["user"], coins, WALLET_DEFAULT_NAME) + in_wallet = self._default_wallet(event["user"], "in") + self._give(event["server"], event["user"], coins, in_wallet) self._remove_user_wallet(event["user"], wallet) event["stdout"].write("%s: removed wallet '%s' and shifted any funds " - "to your default wallet" % (event["user"].nickname, wallet)) + "to your default 'in' wallet" % (event["user"].nickname, wallet)) @utils.hook("received.command.defaultwallet", authenticated=True, min_args=1)