Bitcoin Forum
October 09, 2026, 01:49:51 PM *
News: Latest Bitcoin Core release: 31.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: In what orders does the output of listunspent is printed?  (Read 35 times)
takuma sato (OP)
Hero Member
*****
Offline

Activity: 915
Merit: 825



View Profile
October 08, 2026, 08:14:27 PM
 #1

When you use 'listunspent' in the console command of Bitcoin Core you get an output that prints something like this:
Code:
[
  {
    "txid": "redacted",
    "vout": 1,
    "address": "1address.............................",
    "label": "redacted",
    "scriptPubKey": "redacted",
    "amount": 0.01,
    "confirmations": 100,
    "spendable": true,
    "solvable": true,
    "desc": "pkh([redacted/redacted/redacted/0h/0/0]redacted)#redacted",
    "parent_descs": [
      "pkh(redacted/redacted/1h/0h/0/*)#redacted"
    ],
    "safe": true
  },
(...)

]

I was wondering, in which order does it show up? It is definitely not chronological, because I see a recent transaction with 100 confirmations, then a bunch of older transactions with 40k+ confirmations, then a couple recent ones with 100 confirmations or less at the bottom. This is a full node with pruned=0 in testnet4 btw.




▄███████████████████████▄
█████████████████████████
██████████▀▄▄▄▀██████████
█████████░█████░█████████
████████▀▀░▄▄▄░▀█████████
███████░░░█████░░░███████
██████░░░▐█████▌░░░██████
██████░░░▐█████▌░░░██████
██████░░░▐█████▌░░░██████
███████░░░█████░░░███████
████████▄▄░▀▀▀░▄█████████
█████████████████████████
▀███████████████████████▀
 
 Lock.com 
█▀▀
█
█
█
█
█
█
█
█
█
█
█
█▄▄
▀▀█
█
█
█
█
█
█
█
█
█
█
█
▄▄█
█▀▀
█
█
█
█
█
█
█
█
█
█
█
█▄▄
▀▀█
█
█
█
█
█
█
█
█
█
█
█
▄▄█
 
  Open − code isolated Crypto Wallet     Sign Up    
achow101
Moderator
Legendary
*
expert
Offline

Activity: 4018
Merit: 7850


Just writing some code


View Profile WWW
October 08, 2026, 09:56:18 PM
Merited by LoyceV (4), ABCbits (1), nc50lc (1)
 #2

There is no particular order.

The order is based on the iteration order of a std::unordered_map, which, as the name suggests, does not have any particular order. It's basically random.

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!