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
multi: fix chain notif. blocking by pmt processor. #324
Conversation
d86e97e
to
862d50d
Compare
862d50d
to
3e298c1
Compare
This incorporates wallet rescanning into the payment process to restore tx conf functionality when the wallet gets into an error state. Associated tests have been added.
3e298c1
to
cd7a037
Compare
This dedicates a lifecycle process for payment processing and updates the necessary configs. Payment processing is now triggered via signals from the chainstate to the payment manager. Associated tests have been added.
cd7a037
to
3260806
Compare
Tried deploying the latest, along with my additional logging, and I'm seeing this:
|
This updates the dividend payment process to get the lowest failing tx conf height to use for the start of a wallet rescan to ensure all failing tx confs are covered.
3260806
to
f734f31
Compare
This fixes an issue where the tx hashes sent in the notification request were duplicates of each other because of taking slice of the iterator variable. The stopAfter param was also updated to send over the correct parameter (conf count) instead of a block height.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed a thorough review, comments attached.
As we have discussed on Matrix, I am really not a fan of this change because we are adding a large amount of code to work around a bug in dcrwallet, which should really be fixed there. In order to ensure we come back and remove this code later, I would like to propose two things:
- We add a good, lengthy comment to the code, to explain the dcrwallet bug and why the rescan is necessary.
- We immediately open a new issue on the dcrpool repo to remove this code as soon as Transaction not spendable dcrwallet#1740 is fixed. It should link to this PR and to the dcrwallet issue for reference.
c5caa49
to
e673794
Compare
This fixes chain notification messages being blocked by payment processing calls when tx confirmations are not accurately being reported.
The fix includes:
ensuring a payment processing call concludes before starting another one via the processing flag.
calling the payment process in a goroutine to avoid blocking the chain state process.
keeping track of tx confirmation failures and starting a wallet rescan if the failures exceed threshold.
Associated tests have been updated.