Bitcoin Forum
May 11, 2024, 06:31:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind sendtoaddress response delay  (Read 750 times)
myusuario (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
February 14, 2014, 06:24:05 PM
 #1

Hi,
I am developing a web application and using bitcoind to accept and pay with bitcoin, i have one page to create new address on demand for users and another page where user can  withdraw bitcoins.

The problem is with the sentoaddress rpc command, i have a queue of withdrawals, i iterate thw queue and call the rpc command sendtoaddress but after 2 or 3 commands the bitcoind frezze, i'm using java (spring mvc) and to connect to bitcoind i'm using apache httpclient.

Code:

for (Retiro retiro : retiros) {
          HttpClient httpClient = HttpClients.createDefault();
          HttpPost httpPost = new HttpPost(urlCnx);
          String enviar = "{\"method\": \"sendtoaddress\",\"params\": [\"" + retiro.getDireccion() + "\"," + retiro.getMonto() + "],\"id\":\"0\"}";
                        StringEntity entidadEnvio = new StringEntity(enviar);
                        httpPost = new HttpPost(urlCnx);
                        httpPost.setEntity(entidadEnvio);
                        HttpResponse respuestaEnviar = httpClient.execute(httpPost);
                        Object objeto = gson.fromJson(getReader(respuestaEnviar.getEntity().getContent()), Object.class);
}
Please any suggestions
1715452312
Hero Member
*
Offline Offline

Posts: 1715452312

View Profile Personal Message (Offline)

Ignore
1715452312
Reply with quote  #2

1715452312
Report to moderator
1715452312
Hero Member
*
Offline Offline

Posts: 1715452312

View Profile Personal Message (Offline)

Ignore
1715452312
Reply with quote  #2

1715452312
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
theonewhowaskazu
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250


View Profile
February 14, 2014, 08:34:18 PM
 #2

This was happening to me, for some reason bitcoind was using up a ton of memory causing the freeze.

myusuario (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
February 17, 2014, 04:31:58 PM
 #3

Hi i find a solution, i change HttpClient to CloseableHttpClient and after each sendtoaddres i close the conection, i try several times and now is working fine.  Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!