2

Wondering if I call listsinceblock "", will I get all transactions that ever occurred on the blockchain regardless of whether my wallet was party to it, or will it only be a list of transactions relevant to my wallet (things I've sent/received/have a private key for at least one side of) ?

Caius Jard
  • 197
  • 7
  • 1
  • ... from all accounts within your own wallet, see here https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list: "listtransactions" Returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] not provided it'll return recent transactions from all accounts. – pebwindkraft Mar 16 '18 at 12:12
  • Can you please clarify why you posted the help file text for listtransactions when I asked about listsinceblock ? – Caius Jard Mar 17 '18 at 06:42
  • 1
    Oops, yup, I see, I have mixed things up. The previous line on the same page refers to listsinceblock. Another link would be here: https://bitcoin.stackexchange.com/questions/25103/listsinceblock-parameter-target-confirmations, and also here: https://bitcoin.stackexchange.com/questions/32748/monitor-non-wallet-bitcoin-addresses-for-new-transactions/32755#32755. in general: if you set “txindex=1” in bitcoin.conf, then also foreign (non wallet addresses) can be seen. – pebwindkraft Mar 17 '18 at 07:18

1 Answers1

1

listsinceblock will only list txs your wallet is interested in i.e. transactions involving as input or as output an address A such that:

  • either A is an address whose private key is known to your wallet and consequently can sign transactions that spend UTXOs of A
  • or A is an address your wallet is following as watch-only i.e. does not know A's private key but A was added to the wallet using importaddress

listtransactions will also only return transactions your wallet is interested in but with different criteria. It returns count most recent txs of interest (as per above criteria) and you can also define to omit most recent skip txs and also filter by label (or account for older versions which is not deprecated).

All in all, following two should both return all txs your wallet is interested in:

bitcoin-cli listsinceblock <hash_of_genesis_block> 1 true
bitcoin-cli listtransactions "*" <a_number_greater_than_your_wallet_total_tx_count> 0 true

There is no direct way through CLI to return all txs in the blockchain afaik.

thalisk
  • 483
  • 3
  • 11
  • In the second case (i.e., A is imported as watch-only address in the wallet), will listsinceblock also show any coinbase transactions that used "A" as an output? – Shobit Oct 16 '21 at 05:50
  • @Shobit I can't think of a reason why not. In that case "category" value would be "immature" or with > 100 confirmations "generate". – thalisk Oct 17 '21 at 14:07
  • @ThalisK. is it true that “deposit” transactions are only the ones with “receive” as category? And how to consider receive transaction with 0 as amount? A deposit amount of 0 I think that is not a deposit – Giacomo Brunetta May 09 '22 at 01:23
  • 1
    @AlfonsoSilvestri Also a coinbase transaction is a "deposit" (type "immature" and after 100 confirmations becomes "generate" and is spendable). A tx with amount == 0 can safely be ignored IMO. – thalisk May 09 '22 at 16:53