Fixed contract once not running stop callback.

This commit is contained in:
Richard Moore 2023-07-11 20:42:43 -03:00
parent 3c17cf56b5
commit 7d061b786f

@ -593,6 +593,12 @@ async function _emit(contract: BaseContract, event: ContractEventName, args: Arr
} catch (error) { } } catch (error) { }
return !once; return !once;
}); });
if (sub.listeners.length === 0) {
sub.stop();
getInternal(contract).subs.delete(sub.tag);
}
return (count > 0); return (count > 0);
} }