<p>I have found the solution: the problem was that I was generating an insane fee by specifying an amount which was too small compared to the inputs.</p>

<p>I have discovered it by compiling the last version and not using the precompiled package, which seems to be older...</p>

CC BY-SA 3.0
2014-10-06T17:27:02.600Z
2014-10-06T17:27:02.600Z
fcracker79
<p>I have a problem trying to make a transaction using bitcoind/bitcoin-cli in regtest mode (I do not know if it works in other modes).</p>

<pre><code>bitcoin-cli -regtest createrawtransaction '[{"txid" : "e5db3c4fd05d1b8f979de45aca1ebb78b4bd356920cc07b9f374d8c9838d4b5a","vout":0}]' '{"misCfm4sZJDsU3uYHp9NrUZjH3y5rgHrJx":5}'
-&gt; 01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe50000000000ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000

bitcoin-cli -regtest signrawtransaction 01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe50000000000ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000
-&gt; {
"hex" : "01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe5000000006b483045022100c4c38395683460872f35971fb808a3a28f4d0e16793739760265af6339078a5a02201e5b960e3a97102797282ddb421edca84869ad296da145e55e00dcae747c7c4701210227b858d4f7f75e26ce370e3c0b862e4b9518da6f9cc6d4012008d9b829db9003ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000",
**"complete" : true**
}

bitcoin-cli -regtest sendrawtransaction 01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe5000000006b483045022100c4c38395683460872f35971fb808a3a28f4d0e16793739760265af6339078a5a02201e5b960e3a97102797282ddb421edca84869ad296da145e55e00dcae747c7c4701210227b858d4f7f75e26ce370e3c0b862e4b9518da6f9cc6d4012008d9b829db9003ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000
-&gt; **error: {"code":-25,"message":""}**
</code></pre>

<p>I have had a look at the bitcoind source code. From <em>rpcrawtransaction.cpp</em>:</p>

<pre><code>if (!AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees)) {
        if(state.IsInvalid())
            throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
        else
            throw JSONRPCError(RPC_TRANSACTION_ERROR, state.GetRejectReason());
    }
</code></pre>

<p>So the <em>state.IsInvalid()</em> method returns <strong>false</strong> but the <em>state.getRejectedReason()</em> returns <strong>empty string</strong>.</p>

<p>More in depth, it seems to be that such problems may arise if:</p>

<ol>
<li>The tx is already in the memory pool (mah)</li>
<li>Disable replacement feature for now (boh)</li>
<li>I have already the coins</li>
<li>Some inputs do not exist</li>
</ol>

<p>I am changing the source code to log the reason of my error. Meanwhile, any help would be greatly appreciated.</p>

<p>Thank you.</p>

<bitcoind><rpc-error-25>
Bitcoind transactions in regtest mode always fail with -25 error
fcracker79
# Bitcoind transactions in regtest mode always fail with -25 error

(Asked by: username_0 on 2014-10-06)

I have a problem trying to make a transaction using bitcoind/bitcoin-cli in regtest mode (I do not know if it works in other modes).

```
bitcoin-cli -regtest createrawtransaction '[{"txid" : "e5db3c4fd05d1b8f979de45aca1ebb78b4bd356920cc07b9f374d8c9838d4b5a","vout":0}]' '{"misCfm4sZJDsU3uYHp9NrUZjH3y5rgHrJx":5}'
-> 01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe50000000000ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000

bitcoin-cli -regtest signrawtransaction 01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe50000000000ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000
-> {
"hex" : "01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe5000000006b483045022100c4c38395683460872f35971fb808a3a28f4d0e16793739760265af6339078a5a02201e5b960e3a97102797282ddb421edca84869ad296da145e55e00dcae747c7c4701210227b858d4f7f75e26ce370e3c0b862e4b9518da6f9cc6d4012008d9b829db9003ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000",
**"complete" : true**
}

bitcoin-cli -regtest sendrawtransaction 01000000015a4b8d83c9d874f3b907cc206935bdb478bb1eca5ae49d978f1b5dd04f3cdbe5000000006b483045022100c4c38395683460872f35971fb808a3a28f4d0e16793739760265af6339078a5a02201e5b960e3a97102797282ddb421edca84869ad296da145e55e00dcae747c7c4701210227b858d4f7f75e26ce370e3c0b862e4b9518da6f9cc6d4012008d9b829db9003ffffffff010065cd1d000000001976a91424bcb21358f61d207207c1cb01921ab602948b9488ac00000000
-> **error: {"code":-25,"message":""}**

```

I have had a look at the bitcoind source code. From *rpcrawtransaction.cpp*:

```
if (!AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees)) {
        if(state.IsInvalid())
            throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
        else
            throw JSONRPCError(RPC_TRANSACTION_ERROR, state.GetRejectReason());
    }

```

So the *state.IsInvalid()* method returns **false** but the *state.getRejectedReason()* returns **empty string**.

More in depth, it seems to be that such problems may arise if:

1. The tx is already in the memory pool (mah)
2. Disable replacement feature for now (boh)
3. I have already the coins
4. Some inputs do not exist

I am changing the source code to log the reason of my error. Meanwhile, any help would be greatly appreciated.

Thank you.

**Tags:** bitcoind, rpc-error-25


---

## 1 answers

### Answer by username_0 on 2014-10-06. Score: 3

I have found the solution: the problem was that I was generating an insane fee by specifying an amount which was too small compared to the inputs.

I have discovered it by compiling the last version and not using the precompiled package, which seems to be older...


---

