treverse swap: check that received amount is higher than dust threshold - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 5f7d8cc462aeda034a7957e8d27134a4b299bf6a DIR parent 6d67e7713672f325f873b9ca3ee60ff9970810f2 HTML Author: ThomasV <thomasv@electrum.org> Date: Thu, 3 Sep 2020 16:40:11 +0200 reverse swap: check that received amount is higher than dust threshold Diffstat: M electrum/submarine_swaps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py t@@ -18,7 +18,6 @@ from .lnutil import hex_to_bytes from .json_db import StoredObject from . import constants - if TYPE_CHECKING: from .network import Network from .wallet import Abstract_Wallet t@@ -400,6 +399,8 @@ class SwapManager(Logger): x = int(x * (100 - self.percentage) / 100) x -= self.lockup_fee x -= self.get_claim_fee() + if x < dust_threshold(): + return else: x -= self.normal_fee x = int(x * (100 - self.percentage) / 100)