-
Notifications
You must be signed in to change notification settings - Fork 3
fix: We should check if the mempool is loaded instead of taking an empty array #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…pty array Signed-off-by: kevkevinpal <oapallikunnel@gmail.com>
355033c to
be9d80a
Compare
|
My node is still reindexing, so I have not checked that this works after it's complete yet will check again in a day probably |
Cool, let us know when you confirm. On the one hand, I could see putting this mempool sync check inside the startup method instead of calling it every 30 seconds. One could argue that a minimum requirement to use augur is a synced node. On the other hand, making this one extra call probably doesn't affect performance too much so if it's helpful to the user then maybe it's fine to make this call regularly. @sanket1729 or @rloomba do you have an opinion? |
I was able to test and it is working for me once synced.
The only issue I can think of if we check only at startup is if something happens to bitcoind while Augur is running then we will arrive at the same issue. I do agree that calling |
|
|
ok I realized we should probably be doing getnetworkinfo instead and then checking |
|
I'm going to think about this one a bit more just to make sure there are not any weird cases where a nodes mempool is empty and how to properly detect if it is accepting relayed transactions |
Okay cool yeah take your time! We've also been mostly thinking about this reference repo as a good way to get folks started and not be too complex (i.e., there will probably be edge cases unaccounted for and it won't be fully production ready). Therefore, if this edge case ends up being too much of a pain, no worries. |
This resolves #5
Description
This change introduces a check of the
getmempoolinforpc to check if the mempool is loadedIf the mempool is not loaded, it doesn't make sense to take an empty array as the response, as that is inaccurate. Instead we should get the
No fee estimates available yeterror as a response.Also, an error is thrown, here is the log message
How to reproduce
in order to reproduce the error, run
-txindexon bitcoind (note it will take about 2 days to reindex)Then after 6ish hours of both Augur and bitcoind running this is the response Augur will return
This is the response bitcoind will return for
getmempoolinfoandgetrawmempool