Author

Topic: Sending a raw transaction generated by bitcoin-qt (Read 1610 times)

legendary
Activity: 2912
Merit: 1060
https://github.com/bitcoin/bitcoin/blob/master/src/rpcprotocol.h#L34 here is the rpc error codes and it seems that you are getting -22 which is a
Code:
RPC_DESERIALIZATION_ERROR       = -22, // Error parsing or validating structure in raw format

So you are not creating the correct structure of the raw format.
I managed to push the transaction. I signed it again though so it has a new transaction ID, right? This makes my second transaction fail as it was based on the first which is no longer the one the network sees.

Signing does not change the tx id, the tx id is a hash of your transaction so it shouldn't change unless an output or something like that has changed.

PS The transaction in the wallet is now invalid as a new one was broadcast. Is there an easy way to clear it and sync up with the new one?

Try -reindex that should fix this issue.

That won't delete the old transaction from my wallet though, right?

No
hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
https://github.com/bitcoin/bitcoin/blob/master/src/rpcprotocol.h#L34 here is the rpc error codes and it seems that you are getting -22 which is a
Code:
RPC_DESERIALIZATION_ERROR       = -22, // Error parsing or validating structure in raw format

So you are not creating the correct structure of the raw format.
I managed to push the transaction. I signed it again though so it has a new transaction ID, right? This makes my second transaction fail as it was based on the first which is no longer the one the network sees.

Signing does not change the tx id, the tx id is a hash of your transaction so it shouldn't change unless an output or something like that has changed.

PS The transaction in the wallet is now invalid as a new one was broadcast. Is there an easy way to clear it and sync up with the new one?

Try -reindex that should fix this issue.

That won't delete the old transaction from my wallet though, right?
legendary
Activity: 2912
Merit: 1060
I think you are not escaping your json
hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
PS The transaction in the wallet is now invalid as a new one was broadcast. Is there an easy way to clear it and sync up with the new one?
hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
https://github.com/bitcoin/bitcoin/blob/master/src/rpcprotocol.h#L34 here is the rpc error codes and it seems that you are getting -22 which is a
Code:
RPC_DESERIALIZATION_ERROR       = -22, // Error parsing or validating structure in raw format

So you are not creating the correct structure of the raw format.
I managed to push the transaction. I signed it again though so it has a new transaction ID, right? This makes my second transaction fail as it was based on the first which is no longer the one the network sees.
hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
I generated a transaction using the GUI of bitcoin-qt offline.
I then did a getrawtransaction using the raw debug interface.

I then took the hex string and put that into another machine which was online and did sendrawtransaction.
But then I get a TX rejected code -22.

What am I doing wrong?

Thanks!

You didn't signed the raw transaction
Use signrawtransaction then sendrawtransaction.
I used signrawtransaction offline. Then I tried to use sendrawtransaction using a fresh install of the qt client client. I am still getting TX rejected (code -22). What am I doing wrong?

I can use decoderawtransaction and I see scriptSig with two hex blobs after asm.

Thanks!
hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
I generated a transaction using the GUI of bitcoin-qt offline.
I then did a getrawtransaction using the raw debug interface.

I then took the hex string and put that into another machine which was online and did sendrawtransaction.
But then I get a TX rejected code -22.

What am I doing wrong?

Thanks!

You didn't signed the raw transaction
Use signrawtransaction then sendrawtransaction.

Whoops! Thanks! Smiley
hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
I generated a transaction using the GUI of bitcoin-qt offline.
I then did a getrawtransaction using the raw debug interface.

I then took the hex string and put that into another machine which was online and did sendrawtransaction.
But then I get a TX rejected code -22.

What am I doing wrong?

Thanks!
Jump to: