Bitcoin Forum
July 27, 2024, 04:43:01 PM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What's the reasoning behind the "DoubleValue" Coin Selection code?  (Read 1383 times)
rubensayshi (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
November 28, 2014, 10:28:35 AM
 #1

the comment on PySelectCoins_SingleInput_DoubleValue is a bit vague and I was urious what this way of selecting coins is supposed to achieve?

Quote
We will look for a single input that is within 30% of the target
In case the tx value is tiny rel to the fee: the minTarget calc may fail to exceed the actual tx size needed, so we add an extra
We restrain the search to 25%.  If there is no one output in this range, then we will return nothing, and the SingleInput_SingleValue method might return a usable result

goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3696
Merit: 1356

Armory Developer


View Profile
December 22, 2014, 01:44:21 PM
 #2

I haven't touched this part of the code so I don't know for sure. You should CircusPeanut since he's the last to have modified it (iirc).

This is the comment in PySelectCoins() that calls this method:

Quote
   Intense algorithm for coin selection:  computes about 30 different ways to
   select coins based on the desired target output and the min tx fee.  Then
   ranks the various solutions and picks the best one

This is my guess: if you have to have change you would rather avoid tiny amounts, or you'll have to consolidate all these small amounts at some point, and that will command a large fee. If you have UTXOs with about double the amount you want to spend, you can create a small Tx (1 input) with a large change UTXO.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!