Bitcoin Forum
July 28, 2024, 05:18:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: question about transferring money from many addresses bitcoind  (Read 545 times)
shark255 (OP)
Full Member
***
Offline Offline

Activity: 224
Merit: 100



View Profile
December 11, 2013, 03:12:19 PM
 #1

On many services - gambling and others - every user gets unique payment address.

According to this doc - https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
i can do it with getnewaddress.
Also i can get total amount - getbalance.

And this command -
sendfrom    <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]

What is withdrawal logic ? It takes money from random addressess if only total amount allows to do its operation?
cnk
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
December 13, 2013, 10:48:25 AM
 #2

What is withdrawal logic ? It takes money from random addressess if only total amount allows to do its operation?

bitcoind uses stochastic approximation to select a subset of unspent outputs to spend.
(actual code : https://github.com/bitcoin/bitcoin/blob/master/src/wallet.cpp#L1043-L1185)

There is an old thread about it here: https://bitcointalk.org/index.php?topic=29207.0
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!