-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat(coinjoin): fix private send and regular send #228
Conversation
@@ -58,10 +51,8 @@ public CoinSelection select(Coin target, List<TransactionOutput> candidates) { | |||
protected boolean shouldSelect(Transaction tx) { | |||
if (tx != null) { | |||
for (TransactionOutput output : tx.getOutputs()) { | |||
if (!output.isDenominated()) { | |||
if (!output.isFullyMixed(wallet)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unmixed coins are not fully mixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about partially mixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This question will be answered later.
if(!transactionBag.isFullyMixed(this)) | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoinJoin coins are fully mixed.
outputs.forEach(output -> { | ||
TransactionOutPoint outPoint = new TransactionOutPoint(output.getParams(), output.getIndex(), output.getParentTransactionHash()); | ||
builder.append(" addr:") | ||
.append(Address.fromPubKeyHash(output.getParams(), ScriptPattern.extractHashFromP2PKH(output.getScriptPubKey()))) | ||
.append(" outpoint:") | ||
.append(outPoint.toStringShort()) | ||
.append(" "); | ||
int rounds = ((WalletEx) wallet).getRealOutpointCoinJoinRounds(outPoint); | ||
builder.append(CoinJoin.getRoundsString(rounds)); | ||
if (rounds >= 0) { | ||
builder.append(" ").append(rounds).append(" rounds"); | ||
if (((WalletEx) wallet).isFullyMixed(outPoint)) { | ||
builder.append(" (fully mixed)"); | ||
} | ||
} else { | ||
builder.append(" ").append(output.getValue().toFriendlyString()); | ||
} | ||
builder.append("\n"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will update this section in a wallet dump to include each "output" and the rounds mixed
Outputs:
N/A outputs:11 total:0.00518944 DASH
addr:ydEvmG7LMN8mne4LcGqraHV4v7KsDu5jZ7 outpoint:d7d6f127b9fb262baa49c397fa4f0e3afeba3534ce7e34c72d931bab7a039b58-0 collateral 0.0003 DASH
addr:yQume8R9UgEn1ADfRqUmoqHeTRiDBXWyK4 outpoint:7fcea451f4b633197a0d5c69f651df23628b0c246c8b0dc6b51ab77ba857d6be-0 collateral 0.0004 DASH
addr:yYXBfwGAFAj4R1Gpa7DUgrdHSd7vhpgyY4 outpoint:9745ffa61f8f8c8a8936bb5d59b8d29c4d8630e0d84ab01eb0cfbfc421ab953e-0 collateral 0.0004 DASH
addr:yVCP88cjxHj8qko2fK1dFBdJQQ84Hkr4xV outpoint:713b579b0491feae451eae2a865dbbd7d3ffeef5155c1f579df5bb896498da26-0 collateral 0.0003 DASH
addr:yUBvXJC9jXu8ac5Bm7xW4RSNQJi7sS9Z5Y outpoint:b7e3951e6567013a3b4b9342b766a028ab750de92935423d701cb14d25f26596-1 non-denominated 0.00079648 DASH
addr:yUiFfkDWsAgunwcEYwnrwmmgr8rcP77hNY outpoint:65ffe13000550caa6bbe3e51589cb74611e132e20b72462dd50f2e51cfc4f185-1 non-denominated 0.00079648 DASH
addr:yYrifCGm91rw1BtekrpH62kKck7j9ziCbA outpoint:d38def14895dc7c44f34692fca1f963e675f79f4842b75b68370c0f632a299c9-0 collateral 0.0003 DASH
addr:yP6hq8bFkNozGZAffhhaHUCz2KXmpCPQeb outpoint:7fcea451f4b633197a0d5c69f651df23628b0c246c8b0dc6b51ab77ba857d6be-1 non-denominated 0.00079648 DASH
addr:yMB1KM1XciP7RZ1tfsc2bEt6J8Sv65N5eo outpoint:1c9ede53abf7f28164f6cb567d9432295669e7e89c114af64eec8fd50f317894-1 collateral 0.0004 DASH
addr:yNhrC82fPxV6zecXjtTR13aGPtiTSxKccE outpoint:65ffe13000550caa6bbe3e51589cb74611e132e20b72462dd50f2e51cfc4f185-0 collateral 0.0004 DASH
addr:ybe6i8sg6oNX478mUxVk82VtuHcHspkdCE outpoint:cfcd443d79513b43faa0163d8698a4da2261241921009586a099d4b6e24429f2-0 collateral 0.0003 DASH
10.0001 outputs:0 total:0.00 DASH
1.00001 outputs:0 total:0.00 DASH
0.100001 outputs:0 total:0.00 DASH
0.0100001 outputs:2 total:0.0200002 DASH
addr:ybMRc9tCRkCdxFk3Lcz3fGKkfEAUMEuALD outpoint:77b902728d9dc7d6ab9d75ea2a4fe0673f0f69ec478f948a6214136224a11a37-1 coinjoin 4 rounds
addr:ydKqnTtLkq2xJijip997WS7WkBB22EDKse outpoint:07ee8cbce22bfeefaa92589ce082c28443310bd08596624a12e922f193e956d2-1 coinjoin 2 rounds
0.00100001 outputs:0 total:0.00 DASH
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature-coinjoin #228 +/- ##
======================================================
- Coverage 48.06% 48.04% -0.02%
- Complexity 7195 7197 +2
======================================================
Files 450 451 +1
Lines 49611 49698 +87
Branches 7068 7075 +7
======================================================
+ Hits 23844 23876 +32
- Misses 23036 23082 +46
- Partials 2731 2740 +9
☔ View full report in Codecov by Sentry. |
…esponse * change InsufficientMoneyException result to return false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Issue being fixed or feature implemented
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
For repository code-owners and collaborators only