CounterpartyXCP / counterwallet

Counterparty web wallet
https://counterwallet.io
147 stars 162 forks source link

token sweep list not working #818

Open jdogresorg opened 7 years ago

jdogresorg commented 7 years ago

The "Sweep" functionality does not seem to be paying attention to the "Tokens to sweep" list.

I tried to sweep the address 1Donatet2LrNpuWByAnH8gc9Wh9zSzZuLC using the private key, but just got stuck in infinite loop making create_send requests to the API.

I tried adjusting the list of tokens to be swept to only sweep PEPECASH, yet I still get stuck.... after some investigation of the requests, it appears that counterwallet is still trying to generate a create_send transaction for BTC, even though BTC was not in the list of tokens to sweep.

Sweep screen showing all tokens in address that can be swept image

Sweep screen showing only PEPECASH to be swept image

Request to create_send for BTC??? image

Response to create_send for BTC indicating failure. image

unsystemizer commented 7 years ago
jdogresorg commented 7 years ago

The BTC balance on that address has been the same for a few weeks.

The "insufficient balance" error is indeed common, but my issue is not with that error. :)

My issue is with the fact that counterwallet should only be sweeping PEPECASH (see above screenshot where PEPECASH is only asset in 'tokens to sweep' box), but instead is trying to create a transaction to send BTC.

unsystemizer commented 7 years ago

w00t? That's crazy. It didn't even occur to me that the actual behavior is completely unlike the expected... Can you repro on Testnet? I'd be interested to try and see what happens with those BTC, do they actually get sent? Is that the correct current balance of address you're trying to sweep or some made up number?

I could be a simple filtering issue in the UI.

jdogresorg commented 7 years ago

So... I tried to reproduce the issue on testnet and things got even wierder.

I created a new wallet, funded it with some testnet BTC, burned BTC for XCP, and registered PEPECASHTEST with 1000 tokens.

After all transactions were written to blockchain and confirmed, I then tried to sweep only the PEPECASHTEST tokens.

image

This time the system did not try to sweep my BTC (like it did on mainnet), but instead doubled up on transactions.

It looks like it created 4 transactions (2 Send transactions & 2 issuances/transfer transactions)

image

Here you can see that the wallet balances are funky and indicate 2000 PEPECASHTEST on the move.

image

unsystemizer commented 7 years ago

lol, i've never seen an issue duplicated in a less useful way 🥇

could it be related to the recent UTXO changes that Robby made? just a wild guess. i'm out of other ideas. i've seen problems with sweeping before (9.55 and 9.54), but not of this kind and magnitude. it's either something new (9.55.2 or the latest patches) or very rare that we missed before.