denpamusic / php-bitcoinrpc

Fully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp.
MIT License
283 stars 100 forks source link

Danger! Re-sends RPC call on failure #44

Open ProWagerSystems opened 5 years ago

ProWagerSystems commented 5 years ago

I almost deployed with this library and did a final test and found a problem. Guzzle returned this error (for no discernible reason, but thats not the point of this report): Recv failure: Connection was reset (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

The problem is that this library for some reason re-sent the transaction a second later during the same function call, so it double-sent the coins AND threw an error to top it all off.

You can reproduce this yourself I've wasted too much time already... Just force that error to occur when sending coins and see what happens.

pipizdos commented 5 years ago

there is no code for make double requests, can you post your source?

ProWagerSystems commented 5 years ago

I suspect it had to do with queuing and the message stack... with a failure it would post the same message again, which is dangerous if you're sending bitcoins to a customer. I've since rewritten and finished the project with a much simpler Guzzle-free library. Sorry I can't provide a code sample, free free to close this issue.

denpamusic commented 5 years ago

Sorry for long wait, was not been able to spend any time on this project lately. Glad that you've been able to sort the problem with different library. I'll take a look into this, try to replicate the issue and report it upstream to guzzle project. I don't really want to drop guzzle because of it's support for async requests and because I mostly use this library together with laravel framework which pulls guzzle anyway.

Filingito commented 2 years ago

Has this issue been fixed? Was it really an issue or a user error?