Bitcoin Forum
May 25, 2022, 08:10:29 PM *
News: Latest Bitcoin Core release: 23.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: sendrawtransaction -> "TX rejected" -> TX appears in block  (Read 3936 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.
1653509429
Hero Member
*
Offline Offline

Posts: 1653509429

View Profile Personal Message (Offline)

Ignore
1653509429
Reply with quote  #2

1653509429
Report to moderator
1653509429
Hero Member
*
Offline Offline

Posts: 1653509429

View Profile Personal Message (Offline)

Ignore
1653509429
Reply with quote  #2

1653509429
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1653509429
Hero Member
*
Offline Offline

Posts: 1653509429

View Profile Personal Message (Offline)

Ignore
1653509429
Reply with quote  #2

1653509429
Report to moderator
1653509429
Hero Member
*
Offline Offline

Posts: 1653509429

View Profile Personal Message (Offline)

Ignore
1653509429
Reply with quote  #2

1653509429
Report to moderator
1653509429
Hero Member
*
Offline Offline

Posts: 1653509429

View Profile Personal Message (Offline)

Ignore
1653509429
Reply with quote  #2

1653509429
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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!