Forum Replies Created
-
AuthorPosts
-
alexg
KeymasterHello,
I have implemented most of your suggestions as part of the
0.6.2-beta
release of the Exchange. Thank you!with regards
alexg
KeymasterMegan I saw your reply after I posted mine. Good job, but please see my earlier comment about using the filter to avoid problems on plugin updates.
alexg
KeymasterThe problem with the above solution is that once you switch to double quotes, the sprintf placeholders get interpreted by PHP as inline variables, so the
$
signs need to be escaped.The complete solution suffers from a mild case of LTS, and it is this:
function filter_wallets_ui_text_submit_wd( $string ) { return "Successfully submitted a withdrawal request of %1\$s %2\$s to %3\$s.\nPlease check your e-mail for confirmation instructions."; } add_filter( 'wallets_ui_text_submit_wd', 'filter_wallets_ui_text_submit_wd' );
alexg
KeymasterHello Megan,
If you change the single quotes to double quotes, then you can use escaped characters. You should be able to use
\n
to do a line break. If you are interested, you can learn more about this here.Don’t forget to use the filter to replace the strings, so as not to have to apply your changes to the plugin on every update.
with regards
EDIT: This solution is not entirely correct. Please stand by and I will give you a full example of how to do this shortly.
alexg
KeymasterYes, I couldn’t reproduce this error or find out why it occurs, but I will look again, and hopefully fix it in the next patch. Thank you!
alexg
KeymasterOops, you’re right, I missed this. It will have to be fixed in the next patch.
In the meantime, if you want to try it out, the error is on this line:
https://github.com/dashed-slug/wallets/blob/4.0.3/includes/frontend-settings.php#L80
The line should read
'wallets_sweetalert_enabled'
.alexg
KeymasterVersion
4.0.3
is out with this fix. The withdrawal amounts sent over JSON-RPC APIs to wallets are now floats with 8 decimals.alexg
KeymasterI have fixed some problems with fiat-only and crypto-only shortcodes interfering with each other, in version
4.0.3
. The bugfixes affect the[wallets_deposit]
and[wallets_withdraw]
shortcodes.with regards
alexg
KeymasterSweetalert is now implemented in version
4.0.3
for modal dialogs. It can be turned off in the Frontend Settings, in case it causes any problems.The same will be done for the Exchange extension in a later release.
alexg
KeymasterThank you.
It is extremely unlikely that there will be any more problems with this.
I will release the patch now, as several bug fixes have accumulated since
4.0.2
…kind regards
alexg
KeymasterHmm. That’s interesting.
The problem is that these errors are somewhat hard to reproduce. All this time I’ve been developing the plugin, I’ve never come across this error, and I’ve been testing withdrawals in almost every release. It’s possible that only certain numbers cause this error. Also, I don’t know about OASIS.
In any case, it seems we have the following requirements:
1. Not too many digits
2. Must be a float, not stringTherefore the solution is the PHP round function. Is it possible for you to test OASIS again with this? My tests indicate that Bitcoin core accepts it.
$amount = round( $amount, 8 ); $result = $this->rpc->sendtoaddress( "$address", $amount, "$comment", "$comment_to" );
It should work with both wallets.
alexg
KeymasterI am somewhat surprised that there are so many decimals in the amount, but it is possible that there is a rounding error that’s causing this.
The relevant code is here: https://github.com/dashed-slug/wallets/blob/4.0.2/includes/coin-adapter-rpc.php#L441-L448
Could you try without the
floatval()
function? i.e. edit the code to be:$amount = number_format( (float) $amount, 8, '.', '' ); $result = $this->rpc->sendtoaddress( "$address", $amount, "$comment", "$comment_to" );
Then retry your withdrawal.
If this works I’ll have to patch that line in the next release.
thanks!
alexg
KeymasterIf the output of the commands is compatible with Bitcoin (the documentation suggests that it is), then it will work.
It’s worth a try.
alexg
KeymasterThis will be in the next patch release of the parent plugin. This will be out in a few days.
with regards
alexg
KeymasterHello,
Keeping you updated on this issue:
We now know that the above issues you mentioned were possible when using MyISAM as a MySQL table storage engine. The plugin since warns the user about converting the tables to InnoDB.
Moreover, with the recent feature of available balance calculations, these balance-related issues are now resolved.
with regards
-
AuthorPosts