Bitcoin Forum
December 18, 2017, 07:43:41 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: sendrawtransaction -> "TX rejected" -> TX appears in block  (Read 3798 times)
monsterer
Legendary
*
Offline Offline

Activity: 1008


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.
1513583021
Hero Member
*
Offline Offline

Posts: 1513583021

View Profile Personal Message (Offline)

Ignore
1513583021
Reply with quote  #2

1513583021
Report to moderator
1513583021
Hero Member
*
Offline Offline

Posts: 1513583021

View Profile Personal Message (Offline)

Ignore
1513583021
Reply with quote  #2

1513583021
Report to moderator
1513583021
Hero Member
*
Offline Offline

Posts: 1513583021

View Profile Personal Message (Offline)

Ignore
1513583021
Reply with quote  #2

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

Activity: 80


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


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


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


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


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


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!