[electrum] Performance: make receive_history_callback faster for larger histories
Summary:
The current code was doing very slow ops -- effectively O(n^2) lookups for
large histories, to detect no-longer-in-history txns. We instead use
CPython native implementation of the frozenset difference operator to
accomplish the same thing and turn the operation into O(n).
This is a backport of https://github.com/Electron-Cash/Electron-Cash/commit/c2b697a4c0d0d2243ad553f6916d43751c262966
Depends on D14784
Test Plan:
Receive a transaction and check if the history list still works.
pytest electrumabc/tests/regtest/
Reviewers: #bitcoin_abc, bytesofman
Reviewed By: #bitcoin_abc, bytesofman
Differential Revision: https://reviews.bitcoinabc.org/D14703