Skip to content

Port of stratx implementation of sweep#236

Merged
dangershony merged 1 commit intoblock-core:masterfrom
xandronus:strat-sweep
Nov 18, 2020
Merged

Port of stratx implementation of sweep#236
dangershony merged 1 commit intoblock-core:masterfrom
xandronus:strat-sweep

Conversation

@xandronus
Copy link
Copy Markdown
Contributor

This should be pretty close to the implemenation @zeptin did here stratisproject/StratisFullNode@809186d

Gonna mark this as draft as I still need to test and I think I should probably implement segwit addresses as well but open to initial feedback.

}

/// <inheritdoc />
public IEnumerable<string> Sweep(IEnumerable<string> privateKeys, string destAddress, bool broadcast)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good job.

I wonder if the Sweep has to be part of the WalletManager?
It could get its own class for sweeping that asks the manager for next address.
This will pollute less the manager which is already massive.

Thoughts? (also for @zeptin )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. I was wondering the same thing myself. StratX has a separate layer that we don't have called WalletService. Putting it in manager like I did effectively couples WalletManager with BlockStore which I'm not sure is bad or irrelevant. Not sure what kind of wallet you can have a wallet without a blockstore. Open to suggestions. If you think a separate dependency in the wallet feature is better I can go with that.

Copy link
Copy Markdown
Member

@dangershony dangershony left a comment

Choose a reason for hiding this comment

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

While it would be good to put the code in a new class (not wallet manager) this looks fine.

@dangershony
Copy link
Copy Markdown
Member

@xandronus you want to change this from draft?

@dangershony dangershony marked this pull request as ready for review November 18, 2020 23:21
@dangershony dangershony merged commit 3e78dc0 into block-core:master Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants