How to get both confirmed and unconfirmed transaction details of foreign(non-wallet) addresses from bitcoin-node server? Actually i have generated the addresses using third party library and sent some btc on it. Now i want to know confirmed and unconfirmed transaction details using my own local bitcoin-core node server. Can Somebody help me? Thanks in advance.
2 Answers
If I understand correctly you can use this command getrawtransaction
to get a transaction that is in your node's mempool i.e. an unconfirmed transaction.
However, if you are looking for a transaction that has been confirmed, you'll need to know the blockhash of the block in which that transaction resides.
Example:
> bitcoin-cli getrawtransaction "mytxid" false "myblockhash"
Or if you have enabled -txindex
option on your client then you can use getrawtransaction
and you don't need to supply the blockhash. Check out this question for details on this option.
Refer to this site for a more detailed explanation of the getrawtransaction
command.
-
Actually i want to know the transaction that is send by others into my address and that transaction is not yet confirmed(unconfirmed).Here addresses are created outside the node. Then how we can check status of unconfirmed transactions? Note: We don't have transaction id for unconfirmed receive transaction. We only have address.– JvdDec 28, 2019 at 5:52
-
By unconfirmed do you mean "pending" transactions or transactions in the mempool?– fobaDec 28, 2019 at 21:14
-
Yes, pending transaction of addresses which doesn't belong to my local bitcoin-core node .– JvdDec 30, 2019 at 5:20
-
The only way you can see that pending transaction is if it gets broadcasted and your local node receives it into it's mempool (AFAIK). Are you not able to see the pending transaction in your nodes mempool?– fobaDec 30, 2019 at 5:33
-
you mean to say we can get pending transaction of address into our local node mempool (private keys & address belongs to other node)?– JvdDec 30, 2019 at 5:46
You can use scantxoutset
command which was introduced in Bitcoin Core 0.17. It scans the UTXO set for any UTXOs for the address (or output script) provided. It is faster than the rescan when you import a private key.
Type help scantxoutset
to see the help.
https://bitcoin.org/en/developer-reference#scantxoutset
-
Thanks m1xolyd1an, scantxoutset gives details of confirmed transactions. I am looking for unconfirmed transactions also.– JvdDec 28, 2019 at 5:56