From 8bb930dd041a18073f7274665adb9582e93399b9 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sat, 8 Dec 2018 04:17:05 +0100 Subject: [PATCH] fix OrderedDictWithIndex setitem() would modify the dict of the class. oops. --- electrum/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/util.py b/electrum/util.py index fd2bb4721..d2ca64a0f 100644 --- a/electrum/util.py +++ b/electrum/util.py @@ -1007,7 +1007,9 @@ class OrderedDictWithIndex(OrderedDict): Note: very inefficient to modify contents, except to add new items. """ - _key_to_pos = {} + def __init__(self): + super().__init__() + self._key_to_pos = {} def _recalc_key_to_pos(self): self._key_to_pos = {key: pos for (pos, key) in enumerate(self.keys())}