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

coin selection code does very badly in some cases #1643

Open
dooglus opened this Issue Aug 1, 2012 · 4 comments

Comments

Projects
None yet
6 participants
@dooglus
Contributor

dooglus commented Aug 1, 2012

Take a look at transaction ce9c9afee7b3dd1deebdc49ceb1560d2771acb4cd0a4725042beecde726a3463.

He was trying to send 0.0011 BTC, and was charged 0.0445 in fees. That's a 4045% charge. According to the user, there were "a lot of better fitting inputs".

The coin selection code doesn't attempt to minimise fees. Perhaps it should.

The transaction spent the following outputs:

571 single satoshis, plus these 15 amounts which sum to 0.05559429:

0.00007550 0.00009679 0.00011887 0.00014177 0.00019014
0.00042293 0.00045708 0.00049249 0.00056730 0.00134063
0.00178897 0.00187366 0.00196149 0.01070019 0.03536648

If just the last of those 15 was used, the fee would have been either 0.0005 or 0.

@Xekyo

This comment has been minimized.

Show comment
Hide comment
@Xekyo

Xekyo Sep 13, 2014

Contributor

I have suggested an improvement at #4906 and would appreciate feedback.

Contributor

Xekyo commented Sep 13, 2014

I have suggested an improvement at #4906 and would appreciate feedback.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Jan 23, 2017

Member

I believe #9404 may also have improved upon this.

Member

sipa commented Jan 23, 2017

I believe #9404 may also have improved upon this.

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Jan 23, 2017

Member

@sipa I don't think so, but I might be wrong. The issue is that ApproximateBestSubset right now will try to create an exact match, as was the case when this issue was filed. The bug you are referencing solved a fee calculation bug.

Member

MarcoFalke commented Jan 23, 2017

@sipa I don't think so, but I might be wrong. The issue is that ApproximateBestSubset right now will try to create an exact match, as was the case when this issue was filed. The bug you are referencing solved a fee calculation bug.

@laanwj laanwj removed the Priority Medium label Apr 25, 2017

suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this issue Dec 5, 2017

@Sjors

This comment has been minimized.

Show comment
Hide comment
@Sjors

Sjors Mar 16, 2018

Member

Recent discussion on coin selection #12605

Member

Sjors commented Mar 16, 2018

Recent discussion on coin selection #12605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment