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

Caution: createFundedAddress fails for very small MSC amounts #7

Closed
dexX7 opened this issue Jan 14, 2015 · 3 comments
Closed

Caution: createFundedAddress fails for very small MSC amounts #7

dexX7 opened this issue Jan 14, 2015 · 3 comments

Comments

@dexX7
Copy link
Member

dexX7 commented Jan 14, 2015

When trying to fund an address with an amount that has the last two digits set, it fails.

For example:

createFundedAddress(1.00000000, 0.00000010)
createFundedAddress(1.00000000, 0.00000001)
createFundedAddress(1.00000000, 1.00000010)
...

This is because creating 10 willets would require a BTC payment of 0.000000001 BTC.

@msgilligan
Copy link
Member

I should either remove the two assert statements that check MSC and TMSC balances near the end of the method or adjust them to account for rounding.

@msgilligan
Copy link
Member

I now see my above comment misses the point. There are tests where we need to fund an address with an amount with 1 willet precision.

@msgilligan
Copy link
Member

So there are a couple of approaches (that quickly come to mind) for funding an address with 1-willet precision:

  1. Create a disposable intermediate address and then transfer the exact amount to the real funded address which is returned. (Requires 2 generateBlock calls?)
  2. Send the rounded-up amount via "money man" to the funded address and then send the extra coins away. (Requires 2 generateBlock calls?)
  3. Have a reserved system-wide address that is kept well-funded (i.e. a long-lived, permanent intermediate address) and send coins to the new funded address from this address. (Should work with a single generateBlock call provided the reserved address already has the necessary funds.)

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

No branches or pull requests

2 participants