Bitcoin Forum

Bitcoin => Electrum => Topic started by: jubalix on October 07, 2013, 12:00:01 PM



Title: error: {u'message': u'TX rejected', u'code': -22}
Post by: jubalix on October 07, 2013, 12:00:01 PM
what does this error mean?
error: {u'message': u'TX rejected', u'code': -22}

I get it on 1.7.3


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: ThomasV on October 07, 2013, 03:46:36 PM
probably because you are trying to spend freshly mined coins?
https://github.com/spesmilo/electrum/issues/252


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcven on October 07, 2013, 05:24:33 PM
If not the case above ^ , Set a proper fee and try again.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: jubalix on October 08, 2013, 12:43:44 PM
thanks...some sort of weird fee error

I left enough on the address to pay for the fee and tried to clear the rest...no dice...gives that error.




Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: ThomasV on October 08, 2013, 04:31:36 PM
note: the issue with freshly mined coins has been fixed yesterday:
https://github.com/spesmilo/electrum/issues/252


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: Molex1701 on October 16, 2013, 08:03:28 AM
Hello
  I'm on 1.8.1 and been getting the same error last couple of days.  Coins have 300+ confirmations and been able to send with less before. I've tried different servers, different times of day.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: Tachikoma on October 16, 2013, 10:33:44 AM
How high are your fees?


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: Molex1701 on October 16, 2013, 11:05:00 AM
0.0005. I have 0.01661585 in my wallet. I was trying to send 0.0161 but it wouldn't let me. When I tried to send 0.0160 it worked.  Can't we empty our wallet? 
Thanks
 


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcven on October 16, 2013, 12:36:23 PM
0.0005. I have 0.01661585 in my wallet. I was trying to send 0.0161 but it wouldn't let me. When I tried to send 0.0160 it worked.  Can't we empty our wallet?  
Thanks
 

Try using the short-cut key (!) when setting the amount to send. Maybe the fee is not well calculated yet in 1.8.1


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: Tachikoma on October 16, 2013, 03:37:12 PM
I'm guessing it were all small inputs and the transaction size became very large resulting in a higher required fee. 


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcbot on October 23, 2013, 10:57:58 AM
I've been having a problem with a completely missing transaction visible only (and from where I sent it) in the blockchain with 11+ confirmations.  It's been 3 hours and I've switched servers 10 times or more.  I just solved it.  And I'd done it before the same way.  

I sent, myself a .1BTC from another hot wallet.  It threw the 'TX rejected' error.  I tried this 3 times.  Finally, I increased the send to a 1.1BTC (same default .0005 transaction fee every time) and it threw the error.  Finally, I changed the server to electrum.be and it went through and more interestingly, my other missing transaction was flushed out, too!   8)

All is well, but that reminded me that I'd sent myself a few mBTC before to get a transaction before.  How would that even work?

EDIT: I guess I should read the server thread before I start drawing conclusions...   :D


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: opentoe on October 25, 2013, 04:49:10 AM
Apparently this problem is back again. I've tried just about everything to clear my wallet out. I have multiple coins waiting for me to make a deposit some where else and this little .19 amount is holding me up as the BTC price drops as well.  I can't wait to find a more reliable bitcoin wallet. Everyone I have tried so far has so many bugs, errors it surprises the heck out of me.




Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: atweiden on October 26, 2013, 12:40:31 AM
What is your operating system, and what version of electrum are you using?

Some things you can try (if not already tried):

- right-click on an address in the receive screen, prioritize it
- open/close wallet
- connect to a new server
- restore from seed
- increase the fee

If you've tried all of the above, but you're still receiving this error, you can manually create, sign and send raw transactions with the electrum CLI as follows (on Linux, experts only):

Code:
[live01@Archey ~]$ electrum -w wallet.dat listunspent
[
    {
        "address": "1AwViD7ewnVVrzt58ffQdheyTxMGhAshJ6",
        "index": 0,
        "raw_output_script": "76a9146d078f704c400f1840d02f4239ea8f40ce5a847488ac",
        "tx_hash": "cfed2aac04b2823a679d5d5956462b086ac8d47252d0a5506f9b8d5172d99f75",
        "value": "4"
    }
]

Code:
[live01@Archey ~]$ electrum -w wallet.dat createrawtransaction '[{"txid" : "cfed2aac04b2823a679d5d5956462b086ac8d47252d0a5506f9b8d5172d99f75","vout":0}]' '{"34PTJeM3gtGSk3fqAJ4iWcEsbip46cbDVw":0.001,"1MbbbLkwLUvP4hXiDLE1Ma42sz9T3J89TG":3.9988}'
{
    "complete": false,
    "hex": "0100000001759fd972518d9b6f50a5d05272d4c86a082b4656595d9d673a82b204ac2aedcf0000000000ffffffff02a08601000000000017a9141d9613bb16091ab2876c829e6bd5f56bed14b9ed8740afd517000000001976a914e1ed88cdd3ff3eead6ebffca4493465b44db983a88ac00000000",
    "input_info": "[{\"redeemScript\":null,\"signatures\":null,\"vout\":0,\"txid\":\"cfed2aac04b2823a679d5d5956462b086ac8d47252d0a5506f9b8d5172d99f75\",\"KeyID\":null,\"pubkeys\":null,\"scriptPubKey\":null}]"
}

Code:
[live01@Archey ~]$ electrum -w wallet.dat signrawtransaction '0100000001759fd972518d9b6f50a5d05272d4c86a082b4656595d9d673a82b204ac2aedcf0000000000ffffffff02a08601000000000017a9141d9613bb16091ab2876c829e6bd5f56bed14b9ed8740afd517000000001976a914e1ed88cdd3ff3eead6ebffca4493465b44db983a88ac00000000'
Password:
{
    "complete": true,
    "hex": "0100000001759fd972518d9b6f50a5d05272d4c86a082b4656595d9d673a82b204ac2aedcf000000008b483045022100a8065915b3ad1fa3e41db8d06cecdc11a938671369707e2ee390c1452eb930aa02202dde6b18a6c9f54497ef719784feb9e0a8cb5fc4007ac4f40c5dc73bb3cb6a130141045ce62c5a778c083f623e720e99e00e56235578d22c4b7cebec5c42d4cf86d1b8aa5af0f1f5846e899c98605cbad41a4161d200ce929db5e867977912c2415340ffffffff02a08601000000000017a9141d9613bb16091ab2876c829e6bd5f56bed14b9ed8740afd517000000001976a914e1ed88cdd3ff3eead6ebffca4493465b44db983a88ac00000000"
}

Code:
[live01@Archey ~]$ electrum -w wallet.dat sendrawtransaction 0100000001759fd972518d9b6f50a5d05272d4c86a082b4656595d9d673a82b204ac2aedcf000000008b483045022100a8065915b3ad1fa3e41db8d06cecdc11a938671369707e2ee390c1452eb930aa02202dde6b18a6c9f54497ef719784feb9e0a8cb5fc4007ac4f40c5dc73bb3cb6a130141045ce62c5a778c083f623e720e99e00e56235578d22c4b7cebec5c42d4cf86d1b8aa5af0f1f5846e899c98605cbad41a4161d200ce929db5e867977912c2415340ffffffff02a08601000000000017a9141d9613bb16091ab2876c829e6bd5f56bed14b9ed8740afd517000000001976a914e1ed88cdd3ff3eead6ebffca4493465b44db983a88ac00000000
Connected to electrum.pdmc.net:50002
"be96b4426ca9ecff46a45c90f2ffbd12af5ea42c590180d309a5958a1327fa50"

"{u'message': u'TX rejected', u'code': -22}" is an annoyance, but I've always been able to get around it by playing with the GUI. I've never had to resort to the CLI, except when guiding Macbookers through this process, as they can't seem to prioritize addresses from the GUI.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcven on October 26, 2013, 02:20:44 AM
...except when guiding Macbookers through this process, as they can't seem to prioritize addresses from the GUI.

Maybe the Expert mode was unchecked?


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: opentoe on October 26, 2013, 10:59:02 PM
I was able to make that transaction today. The same one I couldn't yesterday. Needless to say I'm going back to the original bitcoin wallet or even take my chances at using an online one. I don't wan to know how to send coin 10 different ways if one way doesn't work. I just want it to work the way it is supposed to. There is only one more wallet for me to try anyway, so I may as well give it a shot.
Thanks


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: oldbushie on October 30, 2013, 08:07:05 PM
I'm using p2pool, so I get newly minted coins. However, I keep running into the error mentioned in this thread when trying to send an amount that's well under the total matured coins in that wallet. The last time it happened, switching servers was enough to fix it, but this time, trying all suggestions from atweiden didn't work. I didn't try the manual option though. I'm on Windows 7 64-bit using Electrum 1.8.1, with the wallet.dat being set in the command line since I have two wallets.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcven on October 30, 2013, 10:55:07 PM
I'm using p2pool, so I get newly minted coins. However, I keep running into the error mentioned in this thread when trying to send an amount that's well under the total matured coins in that wallet. The last time it happened, switching servers was enough to fix it, but this time, trying all suggestions from atweiden didn't work. I didn't try the manual option though. I'm on Windows 7 64-bit using Electrum 1.8.1, with the wallet.dat being set in the command line since I have two wallets.

Why doesn't you miners, freeze the addresses that you use for the pools so this problem doesn't appear when sending from other addresses?


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: oldbushie on October 30, 2013, 11:33:14 PM
The problem is that this is a miner-only wallet. All the "income" from my miners goes to this wallet. I keep it separate from my main wallet so I only need to transfer the matured coins over to the main wallet once in a while.

I finally got a transaction through; maybe there were too many newly minted coin transactions (3 transactions) in my wallet at the time. Even though, like I said, I was sending well below the total of matured coins.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: oldbushie on November 03, 2013, 08:08:46 PM
Okay, this is getting ridiculous. I tried again today to move some BTC over and it wouldn't work. I thought all I had to do was wait for 120 confirmations? Or is there some other limitation that is not clearly documented for Electrum? I only have one recent transaction of newly minted coins and all the rest of my miner transactions are well over 120 confirmations. I have another transaction that's from less than 24 hours ago but it has 139 confirmations. Either way, sending the contents of my wallet minus those two transactions (and minus a bit more) is not working at all.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcven on November 03, 2013, 10:38:34 PM
minus?

Have you tried freezing the addresses that have receive newly mined coins?

I don't think Electrum can select +120 confirmations inputs over newly mined coins. You would need to manually create the transaction if you want to spend from addresses that carries unconfirmed inputs.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: oldbushie on November 03, 2013, 11:22:19 PM
But that doesn't make any sense. How else am I supposed to extract money from a wallet that's continually receiving newly minted BTC more than once a day?

Freezing the mining address doesn't do a whit of good because that's the only source of transactions. It just states (correctly) that there's insufficient balance if I do that.

Is there any chance of this working correctly for Electrum in the future? Or will I have to set up a regular Bitcoin-QT instance just to move coins out? Or will I see the same problem with the base client?

I have no clue where to even start with manual transactions on a Windows PC and I don't want to accidentally screw something up. I can't follow atweiden's command prompt instructions because they are not allowed on Windows yet.

The "minus a bit more" was so there would be a buffer between the mature and newly minted coins. I just took the wallet total, subtracted the value of the last two transactions, subtracted a little bit more, and then tried to send to my main wallet.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: btcven on November 03, 2013, 11:39:40 PM
Try opening an issue on github (https://github.com/spesmilo/electrum/issues) (check if there is not already one about newly mined coins and this error). Then try on the IRC channel #electrum about this specific issue and how to make it work on Windows.

If you are tied to that address as your only source, you'll find the same problem almost on any bitcoin client. Maybe 0.9 with CoinControl would save you? I don't know the answer.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: ImI on November 03, 2013, 11:45:20 PM
But that doesn't make any sense. How else am I supposed to extract money from a wallet that's continually receiving newly minted BTC more than once a day?

Freezing the mining address doesn't do a whit of good because that's the only source of transactions. It just states (correctly) that there's insufficient balance if I do that.

Is there any chance of this working correctly for Electrum in the future? Or will I have to set up a regular Bitcoin-QT instance just to move coins out? Or will I see the same problem with the base client?

i had the same problem. fortunately the problem ocurred while i tried to do an umimportant transaction. if that would have been a time-sensitive issue i would have gone mad.

i switched to the base client and the problem is gone.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: oldbushie on November 04, 2013, 12:42:53 AM
A friend suggested I try Armory to see if that works better with newly minted coins, so I'm giving that a go. Just need to get bitcoind up to date on my main pc...

I'll try asking on the irc channel as well, thanks.

Edit: Issue #355 opened.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: opentoe on November 06, 2013, 11:11:42 PM
A friend suggested I try Armory to see if that works better with newly minted coins, so I'm giving that a go. Just need to get bitcoind up to date on my main pc...

I'll try asking on the irc channel as well, thanks.

Edit: Issue #355 opened.

God no, The Armory is even worse. Their latest version you need at least 64bit OS with over 8GB of memory for it to even start working properly. I've been using Multibit with great success.



Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: EagleTM on November 11, 2013, 07:44:24 PM
This issue should be fixed in 1.9.3 - Win/Mac builds will be available some time this week.


Title: Re: error: {u'message': u'TX rejected', u'code': -22}
Post by: oldbushie on November 20, 2013, 02:47:52 AM
Just a quick note that I haven't seen this error anymore. HOWEVER, the ! shortcut key is not smart about automatically detecting all spendable coins. It just grabs everything in my wallet, even transactions that haven't completed yet and coins that were just generated an hour ago.