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

CWallet: EstimateAnonFeeIncluded (WIP) #72

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

kewde
Copy link

@kewde kewde commented Nov 15, 2016

This is fix for #66.
Work in progress, needs testing.

Created EstimateAnonFeeIncluded

EstimateAnonFeeIncluded calculates how much you can spend such that nValue + nFees < nMaxAmount.
Searches for nValue (while loop) until value found that equation makes sense.
while loop reduces nMaxAmount with nTransactionFee (lowest steps I could imagine) until an acceptable value is found.

TODO:
spend dust as fee so wallet shows a zero balance.
@kewde
Copy link
Author

kewde commented Nov 15, 2016

still need to include:

left_overs = GetShadowBalance() - nValue - nFees
if(left_overs < nTransActionFee){
    //spend dust as fee to stakers
}

where nValue is the actual value to be transferred.

Added and cleaned up debugging
Improved JSON RPC estimateanonfee output
Found segmentation fault on narration
@kewde
Copy link
Author

kewde commented Nov 16, 2016

Removed the PRId64 which caused failure on windows builds.
Casting int64_t to int when LogPrintF().

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.

None yet

1 participant