Bitcoin Forum
May 02, 2024, 10:56:22 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind listunspent() & createrawtransaction()  (Read 545 times)
randomuser543 (OP)
Newbie
*
Offline Offline

Activity: 23
Merit: 0


View Profile
May 14, 2016, 01:48:32 PM
 #1

Imagine I have 20 different unspent outputs, ranging in value from 0.0001 BTC - 1.0 BTC.

Now, supposing I need to create and send 0.01 BTC in a raw transaction. I'm wondering how you guys choose what unspent outputs to use.

Obviously any unspent output >= 0.01 can be used, but is there a preferred way of doing this?

listunspent -> pick an unspent output that has the most confirmations and is >= 0.01.
listunspent -> pick any unspent output as long as it's >=0.01.
etc.
1714647382
Hero Member
*
Offline Offline

Posts: 1714647382

View Profile Personal Message (Offline)

Ignore
1714647382
Reply with quote  #2

1714647382
Report to moderator
1714647382
Hero Member
*
Offline Offline

Posts: 1714647382

View Profile Personal Message (Offline)

Ignore
1714647382
Reply with quote  #2

1714647382
Report to moderator
1714647382
Hero Member
*
Offline Offline

Posts: 1714647382

View Profile Personal Message (Offline)

Ignore
1714647382
Reply with quote  #2

1714647382
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714647382
Hero Member
*
Offline Offline

Posts: 1714647382

View Profile Personal Message (Offline)

Ignore
1714647382
Reply with quote  #2

1714647382
Report to moderator
1714647382
Hero Member
*
Offline Offline

Posts: 1714647382

View Profile Personal Message (Offline)

Ignore
1714647382
Reply with quote  #2

1714647382
Report to moderator
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
May 14, 2016, 02:32:07 PM
 #2

Bitcoin Core uses the oldest inputs first since it has the most confirmations and thus a higher priority, I believe there are more than this.

If I were to choose inputs, I would use the oldest inputs first to have a higher priority when I am making a free transaction. Next, I would prefer to spend the UXTOs which can be spent completely, i.e. there will be no change. This reduces the size occupied by the one additional output.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
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!