No Branch/Tag Specified
chat
custom_themes
danger
dev
duke
importviewkey
master
no_mining_until_synced
old_duke
onryo
recurring
0.4.0
0.4.1
0.4.2
0.4.3
0.5.0
0.5.1
0.5.10
0.5.11
0.5.3
0.5.4
0.5.5
0.6.0
0.6.1
0.6.10
0.6.11
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6
0.6.7
0.6.8
0.6.9
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
0.7.7
0.7.9
1.4.2
v0.1.5
v0.1.6
v0.1.7
v0.1.8
v0.1.9
v0.2.0
v0.2.1
v0.2.2
v0.2.3
v0.2.4
v0.2.5
v0.2.6
v0.2.7
v0.2.8
v0.2.9
v0.3.0
v0.3.1
v0.3.2
v0.5.2
v0.5.6
v0.5.7
v0.5.8
v0.5.9
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.8.0
v0.8.1
v0.8.2
v0.8.3
v0.9.0
v0.9.1
v0.9.2
v1.0.0
v1.1.0
v1.2.0
v1.3.0
v1.3.1
v1.4.0
v1.4.1
v1.4.2
Labels
bounty up to 500 HUSH 2001-5000 bounty
bounty between 2001 and 5000 HUSH 501-2000 bounty
bounty between 501 and 2000 HUSH arm
something doesn't work on arm beginners
for new developers bug
may or may not be a bug build
problems building documentation
not enough information feature
new feature high priority
high priority i2p
related to i2p low priority
low priority medium priority
medium priority question
something is not clear release
release label or issue related to it tor
related to tor translation
translation update windows
related to windows wontfix
this won't be fixed
Apply labels
Clear labels
0-500 bounty
bounty up to 500 HUSH 2001-5000 bounty
bounty between 2001 and 5000 HUSH 501-2000 bounty
bounty between 501 and 2000 HUSH arm
something doesn't work on arm beginners
for new developers bug
may or may not be a bug build
problems building documentation
not enough information feature
new feature high priority
high priority i2p
related to i2p low priority
low priority medium priority
medium priority question
something is not clear release
release label or issue related to it tor
related to tor translation
translation update windows
related to windows wontfix
this won't be fixed
No Label
0-500 bounty
2001-5000 bounty
501-2000 bounty
arm
beginners
bug
build
documentation
feature
high priority
i2p
low priority
medium priority
question
release
tor
translation
windows
wontfix
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
This issue currently doesn't have any dependencies.
Reference in new issue
There is no content yet.
Delete Branch '%!s(MISSING)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
This RPC is very expensive, and SD calls it like crazy. SD should only run this RPC if itself has created a ztx and is waiting to see if it is accepted. The only way this data is used is to tell the user if something went wrong with a new ztx, otherwise the data is never shown or rendered to the user. It's a big waste of resources to constantly call it.
Related to #33
@duke I was looking into this and the only thing that calls
z_getoperationstatus
iswatchTxStatus
here: https://git.hush.is/hush/SilentDragon/src/branch/dev/src/rpc.cpp#L1141This looks to be running on a timer every 10 seconds (
updateSpeed
) along with some other RPCs:https://git.hush.is/hush/SilentDragon/src/branch/dev/src/rpc.cpp#L59
There is a quicker timer that will run every 3 seconds (
quickUpdateSpeed
) ifwatchingOps
is not empty. I did not search yet ifwatchTxStatus
gets called anywhere else but sounds like it should be removed from starting on timer and constantly polling. IfwatchingOps
is empty, it should probably also not start a timer here either https://git.hush.is/hush/SilentDragon/src/branch/dev/src/rpc.cpp#L1183. That might cause it to keep polling too after the first time it's called.I'll try playing around with some of this code.
@fekt you are right, it's only called in 2 places, which makes it easier to modify. Currently it starts polling no matter what, when the wallet starts and it also calls it when a new tx is made.
The reason for always looking is that maybe hushd was started manually and/or there is code or hush-cli or cron jobs/etc that make transactions. Only looking when a new tx is made is much more efficient.
One way we could change this is to assume that if people have an autostarted embedded hushd, they are not using external code or crons and to not always call
watchTxStatus()
on wallet start for those people. For people where SD detects an already running hushd, we want to be able to detect changes from the CLI, so it's probably good to always run it. Your thoughts @fekt ?@fekt we could also add an option, if you right click anywhere in the Transaction list, that one option/action is "Look for new transactions" which calls
watchTxStatus()
@duke I think it's fixed in this but probably needs to be tested further if it causes any issues. May need to test with a failed tx. Not sure if anything else may rely on this being polled regularly or if started on timer for a reason:
26a9788f7f
I changed to not start the txTimer on load and stop it when
watchingOps
is empty. I tested sending txs and z_getoperationstatus seems to now only run when sending a tx, polls withquickUpdateSpeed
, and stops when tx successfully sent.Had some comment lag. Not sure if commit I added will cause issues with not running it on start and polling regularly.
I get what you are saying about it possibly being needed to run regularly to detect changes from CLI. This option may be a workaround. I guess I need to test sending txs from CLI with SD open.
Sending from cli updates GUI balance but transactions table never seems to show the txs. I added option to "Look for new transactions" that calls
watchTxStatus()
. This only calls z_getoperationstatus once and timer doesn't keep running.I also see the table refresh every time there's a block update, but these cli sent txs don't show. They don't show on restarts either. Txs sent from GUI show fine. Could be my wallet.
This was a fairly new wallet.dat, but I may have some weird data on disk. On this machine, for whatever reason, when I create a new wallet.dat, it shows me a parital tx history in SD from a previous wallet.dat that I didn't even import keys for. I may have imported the keys to another wallet.dat that's long been renamed or deleted. Is there some data I can try deleting rather than deleting everything and waiting to index?
I was impatient and deleted everything but was still showing old txs from a different wallet. Discovered it was from "Remember shielded transactions" option in settings and stores in
senttxstore.dat
that's stored elsewhere. Chilling until it finishes indexing lol.@fekt you are right, SD does some weirdness when the underlying wallet.dat changes, which causes senttxstore.dat to be out of sync. Currently, if that happens, you will see lots of error API responses in the console, but no weirdness in the GUI. We really should delete data from senttxstore.dat, if it's not in the current wallet.dat, but SD doesn't do that right now. See this issue I created a while ago about this issue: #55
Do you have thoughts on the best way to deal with this? Maybe, if we find that senttxstore.dat has data that isn't in the current wallet, we backup the whole file and start fresh? There are edge cases, like a wallet or hushd crashing and maybe just being out of sync with some data, not all data.
The "right" thing to do is to always move addresslabels.dat and senttxstore.dat out of the way, if you are changing wallet.dat, but I never remember to do that and often I am only doing tests on hushd with new wallets and then later on do tests with SD, so it's not easy or intuitive to do the "right" thing.
Still indexing but I tested sending a tx from cli on another machine running SD 1.3.0. Same issue where the tx never shows in SD. Seems like a pre-existing bug unrelated to this change and may need own issue raised if it should be compatible or fixed under #55
It may be that SD only displays txs from
senttxstore.dat
and hush-cli doesn't use that file or write anything to it. On Linux, this file should be located here:/home/user/.local/share/Hush/SilentDragon/senttxstore.dat
Can't seem to locate on Windows. Thought it'd be in:
C:\Users\user\AppData\Roaming\Hush\SilentDragon
There is an addresslabels.dat and SilentDragon.log. The log could probably use a check to keep under certain size. Mine is ~500 MB and has data from when still KMD assetchain.Not sure on best way to fix. Could be something weird with how/when SD decides to write data to
senttxstore.dat
.@fekt ever since we inherited the feature from the original ZecWallet code,
senttxstore.dat
only stores data sent from SD, it doesn't know anything about tx's sent via hush-cli. I think it's reasonable to call it a bug, and it's maybe possible to fill in the data fromz_getoperationstatus
, i.e. "if we see an opid that is successful for a sent tx, and our senttxstore.dat doesn't have that data, fill it in".We also could improve our RPC's to show all sent/received tx's for a zaddr. SD still doesn't use the
getalldata
RPC yet, which would be much more efficient, and maybe has the data we need.z_getoperationstatus is now called less often, calling this good for now