Bitcoin Forum
July 23, 2018, 10:01:02 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: sendrawtransaction -> "TX rejected" -> TX appears in block  (Read 3823 times)
monsterer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1000


View Profile
October 12, 2013, 05:04:44 PM
 #1

Hi guys,

Getting this weird problem when calling "sendrawtransaction" on bitcoind. I receive a "TX Rejected" error, but there is no message in the debug.log and in fact the transaction then appears in a block ok?

This is on testnet.

Example transaction: http://testnet.btclook.com/txn/f5c743767b10117340e450639fbdbcfdc4e2b0a355081b70c4c6a1b7efb3803c

Anyone experienced this behaviour?

Cheers, Paul.
1532340062
Hero Member
*
Offline Offline

Posts: 1532340062

View Profile Personal Message (Offline)

Ignore
1532340062
Reply with quote  #2

1532340062
Report to moderator
1532340062
Hero Member
*
Offline Offline

Posts: 1532340062

View Profile Personal Message (Offline)

Ignore
1532340062
Reply with quote  #2

1532340062
Report to moderator
1532340062
Hero Member
*
Offline Offline

Posts: 1532340062

View Profile Personal Message (Offline)

Ignore
1532340062
Reply with quote  #2

1532340062
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1532340062
Hero Member
*
Offline Offline

Posts: 1532340062

View Profile Personal Message (Offline)

Ignore
1532340062
Reply with quote  #2

1532340062
Report to moderator
1532340062
Hero Member
*
Offline Offline

Posts: 1532340062

View Profile Personal Message (Offline)

Ignore
1532340062
Reply with quote  #2

1532340062
Report to moderator
1532340062
Hero Member
*
Offline Offline

Posts: 1532340062

View Profile Personal Message (Offline)

Ignore
1532340062
Reply with quote  #2

1532340062
Report to moderator
michagogo
Member
**
Offline Offline

Activity: 80
Merit: 10


View Profile
October 12, 2013, 09:20:05 PM
 #2

Hi guys,

Getting this weird problem when calling "sendrawtransaction" on bitcoind. I receive a "TX Rejected" error, but there is no message in the debug.log and in fact the transaction then appears in a block ok?

This is on testnet.

Example transaction: http://testnet.btclook.com/txn/f5c743767b10117340e450639fbdbcfdc4e2b0a355081b70c4c6a1b7efb3803c

Anyone experienced this behaviour?

Cheers, Paul.

Hard to say for sure without more details, but keep in mind that you'll get a "TX Rejected" message if you try to sendrawtransaction a transaction which is already in your node's mempool.
monsterer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1000


View Profile
October 12, 2013, 09:38:26 PM
 #3

Hard to say for sure without more details, but keep in mind that you'll get a "TX Rejected" message if you try to sendrawtransaction a transaction which is already in your node's mempool.

Aren't those usually accompanied by a debug.log entry about outputs being consumed already? These are unique in that they are fresh transactions using unspent outputs and there is no error in the debug.log after sendrawtransaction appears.
michagogo
Member
**
Offline Offline

Activity: 80
Merit: 10


View Profile
October 13, 2013, 07:51:00 AM
 #4

Hard to say for sure without more details, but keep in mind that you'll get a "TX Rejected" message if you try to sendrawtransaction a transaction which is already in your node's mempool.

Aren't those usually accompanied by a debug.log entry about outputs being consumed already? These are unique in that they are fresh transactions using unspent outputs and there is no error in the debug.log after sendrawtransaction appears.

Did you try a getrawtransaction on the hash to see if it was in the mempool? It wouldn't be rejecting it because the inputs were already spent, it'd be rejecting it as a duplicate.
monsterer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1000


View Profile
October 13, 2013, 10:21:23 AM
 #5

Hard to say for sure without more details, but keep in mind that you'll get a "TX Rejected" message if you try to sendrawtransaction a transaction which is already in your node's mempool.

Aren't those usually accompanied by a debug.log entry about outputs being consumed already? These are unique in that they are fresh transactions using unspent outputs and there is no error in the debug.log after sendrawtransaction appears.

Did you try a getrawtransaction on the hash to see if it was in the mempool? It wouldn't be rejecting it because the inputs were already spent, it'd be rejecting it as a duplicate.

I didn't, but I will do thanks. That will help to rule out that possibility Smiley
monsterer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1000


View Profile
October 13, 2013, 11:34:52 AM
 #6

Did you try a getrawtransaction on the hash to see if it was in the mempool? It wouldn't be rejecting it because the inputs were already spent, it'd be rejecting it as a duplicate.

Bingo! Many thanks for your help - this was being caused by a loop in my code which went awry and tried submitting the same transaction multiple times Smiley

For anyone wondering how to get the hash of a transaction (and therefore TXID) before its been submitted, you can simply call decoderawtransaction on the signed transaction.
michagogo
Member
**
Offline Offline

Activity: 80
Merit: 10


View Profile
October 13, 2013, 12:26:14 PM
 #7

Did you try a getrawtransaction on the hash to see if it was in the mempool? It wouldn't be rejecting it because the inputs were already spent, it'd be rejecting it as a duplicate.

Bingo! Many thanks for your help - this was being caused by a loop in my code which went awry and tried submitting the same transaction multiple times Smiley

For anyone wondering how to get the hash of a transaction (and therefore TXID) before its been submitted, you can simply call decoderawtransaction on the signed transaction.
(or, ya know, just hash it  Tongue)
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!