How to Get Unspent Transaction Outputs from Node

0

There is one API called listunspent, however it doesn't return any outputs, and some threads say that it may be because the address is not imported into the node's wallet.

Then how to retrieve the unspent outputs for any address?

xuanzhui

Posted 2018-06-19T01:46:16.497

Reputation: 109

Answers

2

listunspent will list all unspent outputs of addresses the wallets controls, it will not work for any arbitrary address.

You can importaddress to add any address as a watch-only address, but this may take some time as your node will need to rescan the blockchain to find all associated transactions. Also note that when you use importaddress, you will not be able to spend any funds held at that address, since your wallet will not hold the private keys for it.

chytrik

Posted 2018-06-19T01:46:16.497

Reputation: 10 276

1And when you have the (WIF encoded) private keys, you can import them into the wallet, and then also spend the funds...pebwindkraft 2018-06-19T08:14:16.813