Skip to content

This PR is a combined fix for issues #445 and #446#450

Merged
proletesseract merged 8 commits into
navcoin:masterfrom
mxaddict:master
May 1, 2019
Merged

This PR is a combined fix for issues #445 and #446#450
proletesseract merged 8 commits into
navcoin:masterfrom
mxaddict:master

Conversation

@mxaddict

Copy link
Copy Markdown
Contributor

It seems that PR#447 did not fix the issue entirely, but it did point to the right direction.

This PR has changes that fix both #445 and #446

  1. With original code on 4.6.0 RC, the issue was that a wallet with only a staking address would report negative values for staking report numbers, SAMPLE BELLOW:
{
  "2019-04-26 16:00:00": "0.00",
  "2019-04-25 16:00:00": "-8833.93873429",
  "2019-04-24 16:00:00": "-16719.44565578",
  "2019-04-23 16:00:00": "0.00",
  "2019-04-22 16:00:00": "2.00",
  "2019-04-21 16:00:00": "2.00",
  "2019-04-20 16:00:00": "2.00",
  "2019-04-19 16:00:00": "4.00",
  "2019-04-18 16:00:00": "2.00",
  "2019-04-17 16:00:00": "2.00",
  "2019-04-16 16:00:00": "4.00",
  "2019-04-15 16:00:00": "4.00",
  "2019-04-14 16:00:00": "4.00",
  "2019-04-13 16:00:00": "6.00",
  "2019-04-12 16:00:00": "4.00",
  "2019-04-11 16:00:00": "2.00",
  "2019-04-10 16:00:00": "2.00",
  "2019-04-09 16:00:00": "2.00",
  "2019-04-08 16:00:00": "6.00",
  "2019-04-07 16:00:00": "0.00",
  "2019-04-06 16:00:00": "0.00",
  "2019-04-05 16:00:00": "0.00",
  "2019-04-04 16:00:00": "6.00",
  "2019-04-03 16:00:00": "0.00",
  "2019-04-02 16:00:00": "0.00",
  "2019-04-01 16:00:00": "2.00",
  "2019-03-31 16:00:00": "2.00",
  "2019-03-30 16:00:00": "0.00",
  "2019-03-29 16:00:00": "0.00",
  "2019-03-28 16:00:00": "4.00",
  "Last 24H": "-8833.93873429",
  "Last 7 Days": "-25543.38439007",
  "Last 30 Days": "-25487.38426307",
  "Last 365 Days": "-25202.22851166",
  "Last All": "-25193.35322832",
  "Latest Stake": "-6046.0209064",
  "Latest Time": "2019-04-26 11:57:36",
  "Stake counted": 239,
  "time took (ms)": 1
}
  1. And a wallet with only a spending address would report the whole amount in the output as the transaction amount (Instead of only getting the staked amount) samples bellow:

Screenshot from 2019-04-27 00-32-07

Screenshot from 2019-04-27 00-32-19

The fix in PR #447 Fixed the balance in the wallet with only "spending" address, but caused the same bug to appear on the wallet with only "staking" address

This PR fixes the issue on 3 wallet scenarios :

  • Wallet with spending address
  • Wallet with staking address
  • Wallet with both spending and staking address

Both the transactions list and the stakereport show the correct values based on my testing

@aguycalled

Copy link
Copy Markdown
Member

utACK

@mxaddict mxaddict changed the title This issue is a combined fix for issues #445 and #446 This PR is a combined fix for issues #445 and #446 Apr 30, 2019
Comment thread src/chainparams.cpp Outdated
Comment thread src/consensus/params.h Outdated
@mxaddict
mxaddict force-pushed the master branch 9 times, most recently from d178be9 to 4d5863c Compare May 1, 2019 00:33
@mxaddict

mxaddict commented May 1, 2019

Copy link
Copy Markdown
Contributor Author

@aguycalled , The changes in the branch now should be final, can you give it another look?

@proletesseract proletesseract left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All modified unit tests make sense and are passing, wallet compiles and runs.

@proletesseract
proletesseract merged commit 96198f9 into navcoin:master May 1, 2019
proletesseract added a commit to proletesseract/navcoin-core that referenced this pull request May 2, 2019
This was referenced May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants