Author

Topic: See if TXOs were spent? (Read 168 times)

HCP
legendary
Activity: 2086
Merit: 4361
March 28, 2018, 06: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.
member
Activity: 301
Merit: 74
March 27, 2018, 11:12:33 AM
#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.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
March 27, 2018, 01: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.
full member
Activity: 198
Merit: 130
Some random software engineer
March 26, 2018, 11:52:28 PM
#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
$
member
Activity: 301
Merit: 74
March 26, 2018, 06: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?
Jump to: