<p>The reason for this could be that you spend a long chain of unconfirmed transactions. In 0.14, Core has improved this behaviour and added an startup option called <code>-walletrejectlongchains</code> (needs to be enabled, default is off).</p>

<p>Otherwise your wallet might spend long chains of unconfirmed coins but your node/mempool won't accept them.
Also, have a look at the <code>-limitancestorcount</code> settings and consider reading the pull request <a href="https://github.com/bitcoin/bitcoin/pull/9262" rel="nofollow noreferrer">here</a></p>

CC BY-SA 3.0
2017-03-02T19:31:36.753Z
Hi Jonas,

Thank you for your reply! Could it be that the clients balance gets deducted without the transaction actually reaching the mempool? 

I made a transaction yesterday getting the 404 message described above. The amount was deducted from the balance. When checking if the tx was in the mempool by : getmempoolentry txid response is:

error code: -5
error message:
Transaction not in mempool




Could it be that the client assums the coins are sent despite not being broadcasted on to the network? And how to spend/send the coins again?
Mike Hutting
CC BY-SA 3.0
2017-03-02T19:40:22.993Z
Just to be sure I understand you correctly. Regarding the long chain of unconfirmed transactions. Is the transaction change considered to be part of the long chain of unconfirmed transactions? Like in this example when I start with a balance of 25 BTC on a single address and start sending 100 transactions in <1 hour without any of them being confirmed.
Mike Hutting
CC BY-SA 3.0
2017-03-03T10:26:29.870Z
Hi. The transaction was probably successfully added to the wallet, but could not be broadcasted. So the balance is correct, the transaction is made,... but do to your local mempool policies it could not be broadcasted. You can try to increase your -limitancestorcount (but other peers mempool could reject it) or try to "abandon" the transaction (look for `abandontransaction`).
Jonas Schnelli
CC BY-SA 3.0
2017-03-01T19:52:57.537Z
2017-03-01T19:52:57.537Z
Jonas Schnelli
<p>Now and than I seem to get a consistent false error notification.</p>

<p>Error message:</p>

<blockquote>
  <p>Request error: array ( 'code' => -4, 'message' => '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 the wallet and coins were spent in the copy but not marked as spent here.', ).</p>
</blockquote>

<p>After the notifcation the getbalance and getbalance '' '1' are in conflict. Getbalance not showing the actual balance correct anymore.
Despite the error the bitcoin transactions gets broadcasted correctly on to the network and within a couple of days (most of the time) the transactions get processed successfully.</p>

<p>Info on client</p>

<pre><code>{
  "version": 130000,
  "protocolversion": 70014,
  "walletversion": 130000,
  "balance": 13.56365098,
  "blocks": 455269,
  "timeoffset": 0,
  "connections": 8,
  "proxy": "",
  "difficulty": 440779902286.5892,
  "testnet": false,
  "keypoololdest": 1488349424,
  "keypoolsize": 100,
  "paytxfee": 0.00150000,
  "relayfee": 0.00010000,
  "errors": ""
}
</code></pre>

<p>Anyone here having the same problems lately?</p>

CC BY-SA 3.0
2017-03-01T17:40:02.480Z
Is there any possibility you could try 0.14.0rc1 or later? It has a more useful error message for that error.
Nick ODell
<transactions><bitcoind><unconfirmed-transactions><rpc-error-4>
False error notifcation (double spent) 'code' => -4, 'message'
Mike Hutting
# False error notifcation (double spent) 'code' => -4, 'message'

(Asked by: username_0 on 2017-03-01)

Now and than I seem to get a consistent false error notification.

Error message:

> Request error: array ( 'code' => -4, 'message' => '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 the wallet and coins were spent in the copy but not marked as spent here.', ).

After the notifcation the getbalance and getbalance '' '1' are in conflict. Getbalance not showing the actual balance correct anymore.
Despite the error the bitcoin transactions gets broadcasted correctly on to the network and within a couple of days (most of the time) the transactions get processed successfully.

Info on client

```
{
  "version": 130000,
  "protocolversion": 70014,
  "walletversion": 130000,
  "balance": 13.56365098,
  "blocks": 455269,
  "timeoffset": 0,
  "connections": 8,
  "proxy": "",
  "difficulty": 440779902286.5892,
  "testnet": false,
  "keypoololdest": 1488349424,
  "keypoolsize": 100,
  "paytxfee": 0.00150000,
  "relayfee": 0.00010000,
  "errors": ""
}

```

Anyone here having the same problems lately?

**Tags:** transactions, bitcoind, unconfirmed-transactions, rpc-error-4

> **Comments:**
> **username_1**: Is there any possibility you could try 0.14.0rc1 or later? It has a more useful error message for that error.  

---

## 1 answers

### Answer by username_2 on 2017-03-01. Score: 0

The reason for this could be that you spend a long chain of unconfirmed transactions. In 0.14, Core has improved this behaviour and added an startup option called `-walletrejectlongchains` (needs to be enabled, default is off).

Otherwise your wallet might spend long chains of unconfirmed coins but your node/mempool won't accept them.
Also, have a look at the `-limitancestorcount` settings and consider reading the pull request [here](https://github.com/bitcoin/bitcoin/pull/9262)

> **Comments:**
> **username_0**: Hi username_2,  Thank you for your reply! Could it be that the clients balance gets deducted without the transaction actually reaching the mempool?   I made a transaction yesterday getting the 404 message described above. The amount was deducted from the balance. When checking if the tx was in the mempool by : getmempoolentry txid response is:  error code: -5 error message: Transaction not in mempool     Could it be that the client assums the coins are sent despite not being broadcasted on to the network? And how to spend/send the coins again?  
> **username_0**: Just to be sure I understand you correctly. Regarding the long chain of unconfirmed transactions. Is the transaction change considered to be part of the long chain of unconfirmed transactions? Like in this example when I start with a balance of 25 BTC on a single address and start sending 100 transactions in <1 hour without any of them being confirmed.  
> **username_2**: Hi. The transaction was probably successfully added to the wallet, but could not be broadcasted. So the balance is correct, the transaction is made,... but do to your local mempool policies it could not be broadcasted. You can try to increase your -limitancestorcount (but other peers mempool could reject it) or try to "abandon" the transaction (look for `abandontransaction`).  

---

