samotari / paynoway

A mobile app for testing payment systems against double-spend attacks.
GNU General Public License v3.0
36 stars 8 forks source link

Balance 0 even with known non-zero UTXOs #21

Closed taxmeifyoucan closed 3 years ago

taxmeifyoucan commented 3 years ago

New transactions won't show in the app, only the very first one is in the history. 2 other, sent and received are missing, balance is wrong. Maybe issue with Electrum server? Tested on Android 10

chill117 commented 3 years ago

Fees are quite high now. I hadn't tested the app under these conditions. Bitcoin nodes have different rules for accepting and relaying transactions based on fee rate. If the mempool is over 300 MB then nodes might start rejecting (or not relaying) transactions with fee rate below a certain threshold. Currently that threshold might be above 8 sats / vbyte. In addition, ElectrumX servers could be behind a few blocks or might not see all the unconfirmed transactions.

taxmeifyoucan commented 3 years ago

Sorry, forgot to mention that missing transactions are already confirmed for days so they should be there no matter what is happening in the mempool.

chill117 commented 3 years ago

So after investigation, it looks like this could be caused by no connection to any ElectrumX server. The balance is calculated from your address' current UTXOs. So if the app cannot query for the UTXOs, then the balance will be 0. I'll create new issues that will hopefully fix this.

chill117 commented 3 years ago

As previously said, this bug was caused by the app relying on ElectrumX servers for blockchain-related querying (e.g for an address/scripthash's UTXOs). The app has been migrated to web services (esplora, mempool) APIs. It's possible to self-host an instance of one of the supported web services. These changes will be included in the next release of the app (v2.0.0).