HcashOrg / hcd

HC daemon
ISC License
49 stars 28 forks source link

Failed to validate input on self signed transaction. #60

Closed vladikus10 closed 5 years ago

vladikus10 commented 5 years ago

Hi, I followed this instructions on how to build and sign a transaction. Obviously, I did not create a dummy transaction and used the transaction hash, output index and script from a real transaction.

Overall, the process looked correct, even the signature validation passed (I tried using a different private key and received a verify error, so the signature and private keys are definitely correct). The transaction I created looks like this :

01000000015aa1fb9e9daa6be147fb7f9d8040c6295dd2638544d898c71edd0e57a3ca8c250100000000ffffffff010095ba0a0000000000001976a9142c98015e6f66aaf76bf0e34a2b451b66af60a79a88ac000000000000000001ffffffffffffffff00000000ffffffff6b483045022100875627d0e3d78648690c0387324ac1e71282cc5972ee6dcf605a93de7c81a4150220024e9b67eae18cd83fc68c67c6011be4728eb1056c13c381b20c33b3519638240121032b6f2d4acf053eaf6406c8dbe10e7d8a95bf80f6e751786396fdbad5f3982a6e

The explorer decodes it correctly, but when I try to broadcast I get this error:

Error: -1: Rejected transaction 24ff1a16ef5cf41487e9a10976bc3241256be22114bb1e610dbabe3ef3c3d99f: failed to validate input 24ff1a16ef5cf41487e9a10976bc3241256be22114bb1e610dbabe3ef3c3d99f:0 which references output 258ccaa3570edd1ec798d8448563d25d29c640809d7ffb47e16baa9d9efba15a:1 - execute fail, fail on stack (input script bytes 483045022100875627d0e3d78648690c0387324ac1e71282cc5972ee6dcf605a93de7c81a4150220024e9b67eae18cd83fc68c67c6011be4728eb1056c13c381b20c33b3519638240121032b6f2d4acf053eaf6406c8dbe10e7d8a95bf80f6e751786396fdbad5f3982a6e, prev output script bytes 76a914fa1a05d6a0a80a917d93d6436d642e1d0c113a3d88ac) .

I'm not quite sure what I'm doing wrong here.

The only abnormal thing I see is the "amountin": -1e-8, , but I assume it like that because the transaction was not yet broadcasted.

GladysKellogg commented 5 years ago

Sorry, the reply is late. I wonder if it is related to the params? would you mind providing more detailed information about the params?