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?

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.

  • 1
    And when you have the (WIF encoded) private keys, you can import them into the wallet, and then also spend the funds... – pebwindkraft Jun 19 '18 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.