Bitcoin Forum
November 03, 2024, 05:37:47 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Problem with sending many transactions  (Read 613 times)
wertz (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
January 31, 2017, 09:14:45 AM
 #1

Hello everyone Smiley
I've got a problem with sending transactions from my wallet, I'd like to ask you if there is any solution for that.
I'm running a bitcoin service, where users can deposit and withdraw funds.

To make a withdrawal I use sendtoaddress RPC method.
The problem is that sometimes (mainly when I'm trying to process more than 10 withdrwalas one after another), wallet is throwing an error:
"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
(Wallet will send the transaction after some time despite the error)

After the error occurs, wallet stops tracking the rest of bitcoins it had.

Example:
I have 100 BTC on the wallet (which came to me in one TX).
I start sending, withdrawals are proceeding one after another.
Then, at some moment, the error occurs.
I've already transferred 10 BTCs, but the wallet balance is now 0.
Sometimes when transactions that are already sent receive confirmations, the wallet brings the "lost" amount back (I think that at this time the amount is "frozen" in unconfirmed TXs), but from time to time amount shows up only after a rescan command.

I'm currently using Bitcoin Core v. 1.12.1.

Am I doing something wrong? Is there any solution for transaction rejeted error? Is there any way to prevent "losing" balance?

I have done some research about that and I didn't found any useful informations.

Thank you in advance Smiley
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6885


Just writing some code


View Profile WWW
January 31, 2017, 01:56:01 PM
 #2

Hello everyone Smiley
I've got a problem with sending transactions from my wallet, I'd like to ask you if there is any solution for that.
I'm running a bitcoin service, where users can deposit and withdraw funds.

To make a withdrawal I use sendtoaddress RPC method.
The problem is that sometimes (mainly when I'm trying to process more than 10 withdrwalas one after another), wallet is throwing an error:
"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
(Wallet will send the transaction after some time despite the error)
This happens because you are creating long chains of unconfirmed transactions. When you send a transaction, you create a change output for the change. When you send another one before the first confirms, you are spending from that change output. And so on and so forth. Bitcoin Core will not accept any transactions which are in a chain of 25 or more unconfirmed transactions. You will need to change some options to increase that limit.

After the error occurs, wallet stops tracking the rest of bitcoins it had.

Example:
I have 100 BTC on the wallet (which came to me in one TX).
I start sending, withdrawals are proceeding one after another.
Then, at some moment, the error occurs.
I've already transferred 10 BTCs, but the wallet balance is now 0.
Sometimes when transactions that are already sent receive confirmations, the wallet brings the "lost" amount back (I think that at this time the amount is "frozen" in unconfirmed TXs), but from time to time amount shows up only after a rescan command.
That is interesting. It probably has to do with the transactions getting rejected. This may be a bug.

wertz (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 01, 2017, 05:21:57 AM
 #3

Thank you for the response Smiley

Quote
This happens because you are creating long chains of unconfirmed transactions. When you send a transaction, you create a change output for the change. When you send another one before the first confirms, you are spending from that change output. And so on and so forth. Bitcoin Core will not accept any transactions which are in a chain of 25 or more unconfirmed transactions. You will need to change some options to increase that limit.

May you tell me, which options should I use? On the wiki (https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments) I've found only spendzeroconfchange, but this option is default set as 1, so it shouldn't be a problem.


Quote
That is interesting. It probably has to do with the transactions getting rejected. This may be a bug.

Ok, I'll try to report this on the bitcoin's github page.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6885


Just writing some code


View Profile WWW
February 01, 2017, 05:32:33 AM
 #4

May you tell me, which options should I use? On the wiki (https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments) I've found only spendzeroconfchange, but this option is default set as 1, so it shouldn't be a problem.
The options are a little hidden because they are technically debug options (i.e. you really shouldn't be using this in production). There are two options you need to set, -limitancestorcount=<n> and -limitdescendantcount=<n> where <n> is the maximum number of unconfirmed transactions in a chain that you want. If your transactions are large or you are making large chains, you will also need to set -limitdescendantsize=<n> and -limitancestorsize==<n> where <n> is the maximum total size of unconfirmed transactions in chain that you want.

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!