Bitcoin Forum
May 08, 2024, 01:04:55 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: See if TXOs were spent?  (Read 153 times)
jnano (OP)
Member
**
Offline Offline

Activity: 301
Merit: 74


View Profile
March 26, 2018, 11:33:52 PM
 #1

Why doesn't Core's GUI mark differently spent transactions?
Is there a simple way to check whether a TX(O) was spent?
"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715130295
Hero Member
*
Offline Offline

Posts: 1715130295

View Profile Personal Message (Offline)

Ignore
1715130295
Reply with quote  #2

1715130295
Report to moderator
1715130295
Hero Member
*
Offline Offline

Posts: 1715130295

View Profile Personal Message (Offline)

Ignore
1715130295
Reply with quote  #2

1715130295
Report to moderator
1715130295
Hero Member
*
Offline Offline

Posts: 1715130295

View Profile Personal Message (Offline)

Ignore
1715130295
Reply with quote  #2

1715130295
Report to moderator
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
March 27, 2018, 04:52:28 AM
 #2

Why doesn't Core's GUI mark differently spent transactions?

It doesn't need to mark spent transactions, because once used, it doesn't need to track those transactions outputs anymore. It just store utxos for obvious reasons (block validation) in the chainstate database.

Is there a simple way to check whether a TX(O) was spent?

Yes, just check they are no longer in the utxo database:

Unused:

Code:
$ bitcoin-cli gettxout 6c3695a0eabb70f9269b5117c94270cc74f1597814b9da7b312104b53ac2c13e 1
{
  "bestblock": "00000000000000000027ac11adbd47fccb964c88e26ef94defb2d191ecc5f13d",
  "confirmations": 10,
  "value": 0.15515414,
...
}

Used (or non-existant):

Code:
$ bitcoin-cli gettxout 6c3695a0eabb70f9269b5117c94270cc74f1597814b9da7b312104b53ac2c13e 0
$

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16618


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
March 27, 2018, 06:18:34 AM
 #3

Is there a simple way to check whether a TX(O) was spent?
You can do the opposite: you can see unspent inputs: Click Settings > Options > Wallet > Enable coin control features > OK. Then, click Send, Inputs, see your list.
I've always manually selected which inputs to use, it puts me in charge of fees and consolidations.

jnano (OP)
Member
**
Offline Offline

Activity: 301
Merit: 74


View Profile
March 27, 2018, 04:12:33 PM
 #4

RPC commands are tedious manual work, and also the coin selection dialog doesn't actually show which were spent, only which weren't. It's also kind of tucked away hidden.

I was doing some merging, and it would be much nicer if the main transaction list and the overview tab made it obvious which transactions were already spent.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
March 28, 2018, 11:48:53 PM
 #5

I would assume that this is an "edge case". I don't see why "most people"™ would care what specific UTXOs have been already been spent... because once they've been spent, they're effectively irrelevant to "most users" and it seems the developers have made the same assumptions given the existence of listunspent (and no "listspent" command)

I know you've already mentioned that RPC is tedious, but one way I could think to do it would be RPC with listreceivedbyaddress from which you could extract all the txids that your addresses have received... and then cross reference that with the txids shown by listunspent

You would then be able to identify which txids had been "spent"... (listreceivedbyaddress txids - listunspent txids) although, you'd then need to actually gettransaction on all of the spent txids to figure out the specific "vouts" if you need that specific information.

That should be relatively easy to script.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


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