Closed siulynot closed 6 years ago
Please provide more details other than "not working"
When you call listunspent with an address previously imported with pivx-cli importaddress, the list is empty, but it should not be empty.
With some initial research, it looks like the inner wallet logic has changed to disclude watch only addresses as spendable inputs, because they are not considered unspent since the local wallet can not spend them. I think the root of this change was because watch only address UTXOs were showing up in coin control (still not spendable by local wallet) and caused confusion for users of coin control and watch only addresses since it would work the same on the gui as an owned UTXO, up to the point of trying to actually spend it since it is not able to be signed by the local wallet. I will look into potential solutions and keep the issue updated.
If there is a bounty for this, I can help y'all. I wrote the 2way replay protection for BTCP and I am a core dev of HUSH, and I helped add HUSH to BarterDEX via ElectrumX .
I am very familiar with the wallet code that has this bug.
the solution is to check isspendable:true and to not count it if it is false or ismine:true would work too
Changing the logic here isn't complicated in any sense. We just need to decide how we would like to change this. Leaning towards adding an extra bool to listunspent
that will allow users to determine whether or not they want watch only UTXOs included.
https://chainquery.com/bitcoin-api/listunspent
for a while listunspent returns watchonly, but with the iswatchonly:true, ismine:false, isspendable:false
listunspent now allows allows for configurations that allow watchonly transactions to be shown in the output. Fixed in pull request #539
Using watchonly addresses wont show a balance unless wif key gets imported to native wallet.
In Komodo Platform we are working on a decentralized exchange called BarterDEX that relies on watchonly addreses to show balances in the application. It turns out that we discovered that the PIVX daemon is not working with watchonly addresses and might make users think that they lose PIVX if they interact with a watch only address.