-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Regression test for ResendWalletTransactions #5940
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
Conversation
|
utACK. Two points: Would it make sense to somehow remove this command when running in a non test/dev. mode? I don't have a good idea here (detect --enable-debug, only during How about returning a array of rebroadcasted wtx ids instead of a single count int? |
|
@jonasschnelli : consensus on IRC was just making it hidden is the right thing to do. RE: returning array of txid: good idea, I'll do that. And I'll fix the -DDEBUG_LOCKORDER travis error (RPC method needs to lock cs_main). |
8e4a50a to
d30f1a4
Compare
|
Updated. Note: I decided on |
|
Tested ACK. |
|
This test appears that it would fail to catch an error, if mempool syncing is ever merged. It would be better if the nodes were all restarted concurrently to clear their mempools, but failing that perhaps just a comment on this limitation in the test code would be good to have. |
|
utACK
We'll worry about that then, and if. Could add a comment, I guess. |
|
@luke-jr : if mempool syncing between peers is implemented, then ResendWalletTransactions will probably go away entirely, so this unit test will be obsolete. I suppose I could add a comment, but I think it is usually a mistake to clutter up code with speculative comments about code that may or may not get written in the future. |
Adds a regression test for the wallet's ResendWalletTransactions function, which uses a new, hidden RPC command "resendwallettransactions." I refactored main's Broadcast signal so it is passed the best-block time, which let me remove a global variable shared between main.cpp and the wallet (nTimeBestReceived). I also manually tested the "rebroadcast unconfirmed every half hour or so" functionality by: 1. Running bitcoind -connect=0.0.0.0:8333 2. Creating a couple of send-to-self transactions 3. Connect to a peer using -addnode 4. Waited a while, monitoring debug.log, until I see: ```2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactions``` One last change: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.
d30f1a4 to
0f5954c
Compare
0f5954c Regression test for ResendWalletTransactions (Gavin Andresen)
Adds a regression test for the wallet's ResendWalletTransactions function,
which uses a new, hidden RPC command "resendwallettransactions."
I refactored main's Broadcast signal so it is passed the best-block time,
which let me remove a global variable shared between main.cpp and
the wallet (nTimeBestReceived).
I also manually tested the "rebroadcast unconfirmed every half hour or so" functionionality by:
2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactionsOne last change with this pull request: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.