Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

signet broadcast tx fails randomly #49

Open
pseudozach opened this issue Apr 2, 2023 · 3 comments
Open

signet broadcast tx fails randomly #49

pseudozach opened this issue Apr 2, 2023 · 3 comments

Comments

@pseudozach
Copy link

I traced adb logcat logs during the error and caught the below error line.

I also noticed the wallet is syncing during this time. My tx actually went through after a few minutes so I'm wondering is it possible the broadcast failed because wallet is not synced to chaintip?

Maybe UI should not allow broadcast tx if wallet needs to be fully synced prior to sending?

04-01 22:28:26.952 17961 17996 W System.err: [debug][chain-sync] got headers from 72577 to 74593
04-01 22:28:27.392 17961 18020 W System.err: [debug][pool] got header 136811 from signet-electrumx.wakiyamap.dev
04-01 22:28:27.632 17961 17996 W System.err: [debug][chain-sync] requesting headers from 74593 to 76609
...
04-01 22:28:49.983 17961 17996 W System.err: [debug][chain-sync] got headers from 86689 to 88705
...
04-01 22:28:50.078 17961 17996 W System.err: [debug][chain-sync] requesting headers from 88705 to 90721
...
04-01 22:28:51.555 17961 17996 W System.err: [eee][warn] error broadcasting transaction: Error(-1,wallet is not connected)

@fiatjaf
Copy link
Contributor

fiatjaf commented Apr 2, 2023

Nice catch, thank you.

2023-04-02-083711_549x254_scrot

Looks like the code is just not trying to broadcast if the onchain wallet is in Disconnected state.

2023-04-02-083702_545x242_scrot

But it only reaches Connected state after the headers have been synced.

@fiatjaf
Copy link
Contributor

fiatjaf commented Apr 2, 2023

Does this make sense? Should we be able to broadcast before the headers have been sync? We should, right? Or, if we should not, at the least the UI shouldn't offer that option.

@pseudozach
Copy link
Author

Does this make sense? Should we be able to broadcast before the headers have been sync? We should, right? Or, if we should not, at the least the UI shouldn't offer that option.

I think it's ok that wallet will show "sync" or something during the header download and not allow broadcasting because maybe we'll try to double spend but then I'll ask if it's possible to cache the header data locally because I'm wondering why wallet needs to sync from 0 everytime I launch the wallet. is that regular electrum client behavior?
Can it be optimized?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants