<p>The transaction wasn't going through because of the newly implemented <a href="https://github.com/bitcoin/bitcoin/pull/2577" rel="nofollow">"dust transaction" policy</a> that makes it so that no output of a transaction may total less than 54.3 micro-bitcoins. One of my outputs was below this threshold. So I fixed that, but then the output to the "change" address was pulled below 54.3 uBTC and it still failed. I haven't found a way to ensure electrum doesn't try to deposit less than 54.3 uBTC into the change address, so for now I'm sticking with a single, large input to avoid small amounts of change.</p>

CC BY-SA 3.0
2013-09-21T05:32:16.400Z
You are correct. Normally clients clients avoid this by just paying any input smaller than the dust limit into the fee.
Anonymous
CC BY-SA 3.0
2018-02-27T22:22:03.873Z
// , Thanks much for posting the answer to this, even though you found it out on your own the next day.
Nathan Basanese
CC BY-SA 3.0
2013-06-23T01:15:29.680Z
2013-06-23T01:15:29.680Z
Ponkadoodle
<p>I am trying to script automatic payments without hosting a full node (my server doesn't have enough harddrive space). To do this I'm using electrum's python interface, and I have created a transaction, but when I try to send it, I get the error message: "TX rejected", "code: -22". Looking that up <a href="https://github.com/bitcoin/bitcoin/blob/master/src/bitcoinrpc.h#L51" rel="nofollow">here</a>, it appears that's an error either parsing or validating the transaction. It appears the error was thrown <a href="https://github.com/bitcoin/bitcoin/blob/master/src/rpcrawtransaction.cpp#L559" rel="nofollow">here</a>.</p>

<p>But I cannot determine why. The transaction contains 2 inputs, 2 outputs, and the outputs + fee of 0.0001 = the size of the inputs (as of now) as verified via blockchain.info. The size of the transaction is under 1kb, so the fee is as I understand .0001. I sent an earlier transaction of .0001 with a .0001 fee through the electrum UI and it went through fine. So why is this transaction failing?</p>

<p>The raw transaction is:</p>

<pre><code>01000000029802316bd53cdef6741b40b0a75cbffdfab270b0804f32096dda42594e19d179010000008b483045022100bd8bebb8491689604203806b66dc8c785cfb2362f2af630550bcd08d8789311c0220762ed5f310a15294e4fa9a5da9c4baff19e0f7c74a37430676fa3f7af3b50bb6014104f58c3d2d51eebf504ce13e1f5d3bb6f80c3df2e60212fef826dc2ce5bbe5f833b7ef684005fc6c28f80d7f27f70333471099edd4d41f4176261ae345a4128c46ffffffffd133f259c5e4bc4213136acb2fc4dbe5234732cfbfcc6a2845b83a744ea90e000e0000008b483045022100ec66b8827e4827b63a66840b1976cfc244a5ab20a047dd0d23e33285f63d7967022030c8f4b78277747dce2b085cf84acdd990704b0568c4d6e130a2361892b58e8d014104f58c3d2d51eebf504ce13e1f5d3bb6f80c3df2e60212fef826dc2ce5bbe5f833b7ef684005fc6c28f80d7f27f70333471099edd4d41f4176261ae345a4128c46ffffffff02a00f0000000000001976a9147d7cc528123aca5b820013445abbdff7530db71488ace01f0000000000001976a914742415bbd2c023df6f47e1fb6f5dac5316dc437588ac00000000
</code></pre>

<p>and I uploaded the decoded version (using <code>electrum decoderawtransaction ...</code> or <a href="https://coinb.in/decode-raw-transaction.html" rel="nofollow">https://coinb.in/decode-raw-transaction.html</a> - both give the same output) <a href="http://pastebin.com/raw.php?i=ZGPbfen2" rel="nofollow">here</a></p>

CC BY-SA 3.0
2013-06-22T13:07:08.413Z
The last link doesn't work
Steven Roose
CC BY-SA 3.0
2013-06-22T17:57:58.647Z
@StevenRoose I tested the link, and it works for me. But I uploaded the decoded version to http://pastebin.com/raw.php?i=ZGPbfen2 as well.
Ponkadoodle
<transactions><electrum><error>
Why does this transaction give me an error?
Ponkadoodle
# Why does this transaction give me an error?

(Asked by: username_0 on 2013-06-22)

I am trying to script automatic payments without hosting a full node (my server doesn't have enough harddrive space). To do this I'm using electrum's python interface, and I have created a transaction, but when I try to send it, I get the error message: "TX rejected", "code: -22". Looking that up [here](https://github.com/bitcoin/bitcoin/blob/master/src/bitcoinrpc.h#L51), it appears that's an error either parsing or validating the transaction. It appears the error was thrown [here](https://github.com/bitcoin/bitcoin/blob/master/src/rpcrawtransaction.cpp#L559).

But I cannot determine why. The transaction contains 2 inputs, 2 outputs, and the outputs + fee of 0.0001 = the size of the inputs (as of now) as verified via blockchain.info. The size of the transaction is under 1kb, so the fee is as I understand .0001. I sent an earlier transaction of .0001 with a .0001 fee through the electrum UI and it went through fine. So why is this transaction failing?

The raw transaction is:

```
01000000029802316bd53cdef6741b40b0a75cbffdfab270b0804f32096dda42594e19d179010000008b483045022100bd8bebb8491689604203806b66dc8c785cfb2362f2af630550bcd08d8789311c0220762ed5f310a15294e4fa9a5da9c4baff19e0f7c74a37430676fa3f7af3b50bb6014104f58c3d2d51eebf504ce13e1f5d3bb6f80c3df2e60212fef826dc2ce5bbe5f833b7ef684005fc6c28f80d7f27f70333471099edd4d41f4176261ae345a4128c46ffffffffd133f259c5e4bc4213136acb2fc4dbe5234732cfbfcc6a2845b83a744ea90e000e0000008b483045022100ec66b8827e4827b63a66840b1976cfc244a5ab20a047dd0d23e33285f63d7967022030c8f4b78277747dce2b085cf84acdd990704b0568c4d6e130a2361892b58e8d014104f58c3d2d51eebf504ce13e1f5d3bb6f80c3df2e60212fef826dc2ce5bbe5f833b7ef684005fc6c28f80d7f27f70333471099edd4d41f4176261ae345a4128c46ffffffff02a00f0000000000001976a9147d7cc528123aca5b820013445abbdff7530db71488ace01f0000000000001976a914742415bbd2c023df6f47e1fb6f5dac5316dc437588ac00000000

```

and I uploaded the decoded version (using `electrum decoderawtransaction ...` or <https://coinb.in/decode-raw-transaction.html> - both give the same output) [here](http://pastebin.com/raw.php?i=ZGPbfen2)

**Tags:** transactions, electrum, error

> **Comments:**
> **username_1**: The last link doesn't work  
> **username_0**: @username_1 I tested the link, and it works for me. But I uploaded the decoded version to http://pastebin.com/raw.php?i=ZGPbfen2 as well.  

---

## 1 answers

### Answer by username_0 on 2013-06-23. Score: 2

The transaction wasn't going through because of the newly implemented ["dust transaction" policy](https://github.com/bitcoin/bitcoin/pull/2577) that makes it so that no output of a transaction may total less than 54.3 micro-bitcoins. One of my outputs was below this threshold. So I fixed that, but then the output to the "change" address was pulled below 54.3 uBTC and it still failed. I haven't found a way to ensure electrum doesn't try to deposit less than 54.3 uBTC into the change address, so for now I'm sticking with a single, large input to avoid small amounts of change.

> **Comments:**
> **username_2**: You are correct. Normally clients clients avoid this by just paying any input smaller than the dust limit into the fee.  
> **username_3**: // , Thanks much for posting the answer to this, even though you found it out on your own the next day.  

---

