Skip to content
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

wallet: clear memory leaks from radio doge functions #188

Merged

Conversation

xanimo
Copy link
Member

@xanimo xanimo commented Jan 19, 2024

-total redesign of dogecoin_unregister_watch_address_with_node to alleviate calls to concat
-populate wallet->filename on dogecoin_wallet_new otherwise it's populated by name and freed
-added replace_last_after_delim which searchs for a match and replaces with replacement
-added remove_substr which returns a string with substr removed
-changed wallet cmd to sanity
-sanity cmd test now iterates through multiple addresses
-free waddr and buf and call dogecoin_wallet_next_addr on edge case where we delete our last address
-refactor/fix spvtool.py, fetch.py, .gitignore dummy
-clear spvnode wallet sanity cmd of memleaks
-fix wallet sanity check on windows
-added file_copy function to utils
-check if file exists before performance of file operations
-free remaining waddr during sanity check
-run wallet sanity check in spvtool.py test and verify wallet balance
-run spvtool.py only on returncode match from previous subprocess completion

Copy link
Collaborator

@edtubbs edtubbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, reviewed and tested updates with #187 on x86_64 with linux; verified no memory leaks during the scrape test or address registration/unregistration and docker rpctest ran successfully.

ed@ed-VirtualBox:~/dogecoin/foundation/libdogecoin$ docker run -it --rm xanimo/rpctest cat dummy
File '/home/root/regtest_wallet.db' copied to 'tmp.bin'
address: mggFqzCUQmWWnh9vaoyT4BwKen7EbqhBmY
registered:     1 mggFqzCUQmWWnh9vaoyT4BwKen7EbqhBmY
total:          6.00000000
utxo count:     4
txid:           6a9cfcd9440a2592bc6e3c22a1e3f652faa2e32318cde5b3cf487021fdbeec3d
vout:           0
amount:         1.50000000
txid:           a6df1d393d9e9d72b368688e95ed1b36befafd449e1648ef7dcd18755b77a2a7
vout:           0
amount:         1.50000000
txid:           cc53c8a3af59af47c9bdf06f77c4d80c07b86eb311775040e131f4c183d0fe13
vout:           0
amount:         1.50000000
txid:           4beb4ece61a51608dd6fe7bcbe3519106234e8c6fd40a597d8d4dc3ab862b214
vout:           1
amount:         1.50000000
File '/home/root/temp.bin' renamed to '/home/root/regtest_wallet.db' for mggFqzCUQmWWnh9vaoyT4BwKen7EbqhBmY
unregistered:   true
File 'tmp.bin' copied to '/home/root/regtest_wallet.db'
ed@ed-VirtualBox:~/dogecoin/foundation/libdogecoin$ 

-total redesign of dogecoin_unregister_watch_address_with_node to alleviate calls to concat
-populate wallet->filename on dogecoin_wallet_new otherwise it's populated by name and freed
-added replace_last_after_delim which searchs for a match and replaces with replacement
-added remove_substr which returns a string with substr removed
-changed wallet cmd to sanity
-sanity cmd test now iterates through multiple addresses
-free waddr and buf and call dogecoin_wallet_next_addr on edge case where we delete our last address
-refactor/fix spvtool.py, fetch.py, .gitignore dummy
-clear spvnode wallet sanity cmd of memleaks
-fix wallet sanity check on windows
-added file_copy function to utils
-check if file exists before performance of file operations
-free remaining waddr during sanity check
-run wallet sanity check in spvtool.py test and verify wallet balance
-run spvtool.py only on returncode match from previous subprocess completion
-add Dockerfile for easier implementation
-add to x86_64-linux-dbg in ci.yml
-adapt to use -l for zero prompts during automated testing
@michilumin
Copy link
Contributor

here we go. Notating this in radiodoge issue #3 dogecoinfoundation/radiodoge#3 for later reference.

@michilumin michilumin merged commit 6f2c9a9 into dogecoinfoundation:0.1.3-dev Jan 23, 2024
8 checks passed
@michilumin
Copy link
Contributor

crossreferences

TODO: radiodoge retrofit
dogecoinfoundation/radiodoge#3

Relevant:
#180

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

Successfully merging this pull request may close these issues.

3 participants