Bit-Wasp/bitcoin-lib-php

TX rejected (code -22)

Closed this issue · 18 comments

Is there any way to know this errore
I test the first transaction it works, then i create another one based in the last previous transaction hash.
it not works and get this error.
Can any one help in that?

could you share the raw hex data of the transaction that you tried to send?

Sure,

sendrawtransaction 01000000018f3f46efd0b933e4076f95b4d048ab9742e0d0deffe21beb5071fd8a630a4dfb1b0000006b483045022100fa22c73fabdea3204d20935b02e79fd32c2de7cf05b247917e5d3fbac95c8cd902203837abec93abec2548d3eeb0c661eb2a9e3a30fa62cf867ef00ef00b3ed284c50121028f10e917f4f197eb3ebb5e5b9422d783d7fa6786df19bd8eafd3377c8da8a71effffffff0108460200000000001976a9148eb5eb48c373db22e6bd6f6e5c2c5ad3460f791f88ac00000000
TX rejected (code -22)


this result of decoderawtransaction

{
"txid" : "55b2fa6febe8cdddc32a22eaff087514909fdc0f3975777518e40d057aff50f2",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "fb4d0a638afd7150eb1be2ffded0e04297ab48d0b4956f07e433b9d0ef463f8f",
"vout" : 27,
"scriptSig" : {
"asm" : "3045022100fa22c73fabdea3204d20935b02e79fd32c2de7cf05b247917e5d3fbac95c8cd902203837abec93abec2548d3eeb0c661eb2a9e3a30fa62cf867ef00ef00b3ed284c501 028f10e917f4f197eb3ebb5e5b9422d783d7fa6786df19bd8eafd3377c8da8a71e",
"hex" : "483045022100fa22c73fabdea3204d20935b02e79fd32c2de7cf05b247917e5d3fbac95c8cd902203837abec93abec2548d3eeb0c661eb2a9e3a30fa62cf867ef00ef00b3ed284c50121028f10e917f4f197eb3ebb5e5b9422d783d7fa6786df19bd8eafd3377c8da8a71e"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.00149000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 8eb5eb48c373db22e6bd6f6e5c2c5ad3460f791f OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9148eb5eb48c373db22e6bd6f6e5c2c5ad3460f791f88ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"FJqhLzywMxh5xywBLPQKH7Na1M29szuVvD"
]
}
}
]
}

for which coin is this?

this for my own altcoin, this all for teaching the block chain approach.

I sent you an email can you ssee it.

I really tried to know the problem, but i do not?

-22 is failed to decode transaction.
but the transaction seems fine to me, so it's probably got something to do with your coin ..

I think it a about transaction fees.
How to set it.

doubt it, but to 'set it'...

the amount of fee is the total of the inputs - the total of outputs.
so 'set it' you just create an output to send the coins, another output for the change, and make sure that there's some satoshis left over for fees

Can you write example for that.

I saw in sample
Sendrawtransaction
There is no value for input only for out put

you know the value of the input by looking at the previous output which you're spending

afk11 commented

"There is no value for input only for output" this is true - your transactions spends EVERYTHING at the input you refer to. and amounts that you don't explicitly send somewhere go to miners as a fee.

If you have a blockexplorer and can tell me the version of btc you forked it would go a long way. Is your code up online?

afk11 commented

Did you have any luck with this?

VerifySignature failed

2015-04-01 09:50:45 ERROR: CScriptCheck() : fa80639f1a716de577e2e908a3f149b9b91bd70b0b5dd9b99f85dae6e17a0bef VerifySignature failed
2015-04-01 09:50:45 ERROR: CScriptCheck() : fa80639f1a716de577e2e908a3f149b9b91bd70b0b5dd9b99f85dae6e17a0bef VerifySignature failed
2015-04-01 09:50:45 ERROR: CTxMemPool::accept() : ConnectInputs failed fa80639f1a716de577e2e908a3f149b9b91bd70b0b5dd9b99f85dae6e17a0bef

afk11 commented

Can I close this?

Yes. The problem was to get the valid unspent transaction.
Sent from my Samsung device

-------- Original message --------
From: Thomas Kerin notifications@github.com
Date: 04/13/2015 11:42 PM (GMT+02:00)
To: Bit-Wasp/bitcoin-lib-php bitcoin-lib-php@noreply.github.com
Cc: coingeek coingeek@hotmail.com
Subject: Re: [bitcoin-lib-php] TX rejected (code -22) (#76)

Can I close this?


Reply to this email directly or view it on GitHub.