Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fusion] Consolidating better, misc cleanup #1971

Merged
merged 4 commits into from
Aug 23, 2020

Conversation

markblundeberg
Copy link
Collaborator

  • Make it so that consolidation is always actually shrinking wallet utxo set by each fusion having max of 3 outputs (thus minimum of 8 inputs). This way it always has an endpoint.
  • Misc cleanups of locking in plugin.py
  • Misc other cleanups in plugin.py

The lock wasn't being held everywhere it should, and anyway it
doesn't need to be held so long in the plugins loop.

This switches plugin.lock to be a finer grained lock, and
reverses locking order (see create_fusion)... this likely
needs more work in future.
- At most 3 outputs when we consolidate.
- Therefore consolidation has an endpoint.
- Try to slow down consolidations in late stages.

(Maybe max_outputs should be made into a gui/config option
for the power gamers?)
# Locking order wallet.lock -> plugin.lock.
self.lock = threading.Lock()

self.fusions = weakref.WeakKeyDictionary()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so self.lock only guards self.fusions ? Or? Maybe we can have # Guarded by self.lock here for each attribute it does guard...

@cculianu
Copy link
Collaborator

cculianu commented Aug 22, 2020

Well so I have no further old lady complaints. It seems to run for me. Did you test it and stuff? Is it ready for merge?

@cculianu cculianu added the Cash Fusion Cash Fusion enhancements and features label Aug 22, 2020
@EchterAgo
Copy link

EchterAgo commented Aug 22, 2020

I've been running it with 2 instances since yesterday, I've seen no issues.

@cculianu cculianu merged commit 6c21be2 into Electron-Cash:master Aug 23, 2020
@markblundeberg markblundeberg deleted the consolidating_better branch August 23, 2020 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cash Fusion Cash Fusion enhancements and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants