-
Notifications
You must be signed in to change notification settings - Fork 172
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
GetBalance fix #1192
GetBalance fix #1192
Conversation
note |
@denravonska I believe this applies to more than just the GUI and also fixes one of the three core issues remaining with Bittrex. I just tested it and it appears to fix the short term balance hole problem. (The tests Paul did above and my tests cover the situation that would have affected Bittrex and caused the balance trip.) We need to merge this to staging. |
It looks like they moved these conditions into |
Will look into this also they use different enum as well
…On Sat, Jul 7, 2018, 5:43 AM Marco Nilsson, ***@***.***> wrote:
It looks like they moved these conditions into IsTrusted in the Bitcoin
tree
<https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L2058>.
That might have a larger implication but it combines all the conditions
into one place.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1192 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMrVQNu73ev51XgXJJ7YkuGqG2L2o-jIks5uEKzvgaJpZM4U4yia>
.
|
ive looked at the tree we would have to add a condition thou since with bitcoin its one 1 confirm to be confirmed period. so likely `if (nDepth >= 1 && IsFromMe) if (nDepth >= 10) the rest of bitcoins code there evaluates when confirms is 0 |
Let's stick to a narrow change for this PR. We need to get this in production to fix one of the Bittrex issues. This really needs to go in Annie. We can align Gridcoin to Bitcoin's enum and other changes in a later milestone, where we have more time to test the implications. |
Can you rebase this to staging? |
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.
Would like to see it in IsTrusted as well though.
Crap was gonna look into that today more but got distracted by msi
…On Tue, Jul 17, 2018, 10:47 PM Marco Nilsson, ***@***.***> wrote:
Merged #1192
<#1192>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1192 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMrVQNfxgI62LTqPE7FzDU-LvN8tZ4w6ks5uHswIgaJpZM4U4yia>
.
|
Changed - Balance now includes unconfirmed coins sent by self, #1192 (@Foggyx420).
Here is a simple fix to issue #1175
What happened in GUI is we check if
IsTrusted()
which in the case where if the inputfFromMe
its automatically trusted as it in a in wallet transaction only allowing u to use those inputs without the minimum required confirmations.With
sendtoaddress
it pulls data fromGetBalance()
In
GetBalance()
it does useIsTrusted()
but also checks isIsConfirmed()
(requires 10 confirmations to be true) this breaks the rule allowance fromIsTrusted()
resulting in the issue quez had in #1175 . The fix is to use(pcoin->IsConfirmed() || pcoin->fFromMe)
which respects the 10 confirmation required from received transactions from outside the wallet while respecting the in wallet -> in wallet transactions.This could also explain the occasional erroneous balance numbers when the case of available balance + unconfirmed balance != Total Balance. As unconfirmed does not include fFromMe as the rule considers it trusted as it is in-wallet->in-wallet transaction. and Available Balance did not show the right value as it did not include the in-wallet->in-wallet transaction.
Ive tested both scenarios with complete success.
sendtoaddress
with that being less then 10 confirmations and resulted in a fail.getbalance
rpc now shows the available balance in wallet properly to include if it is a in-wallet->in-wallet transaction while respecting incoming transactions from foreign addresses as unconfirmed. and gui balance shows correctly as well now.