-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error #-25: Missing inputs, code=-25 #930
Comments
That output was already spent in 2014: https://btc.com/105eeeb9c448872c2257f93d5e2b14248c4a800cd69641911aa7e964cf570872#in_0 Even still, you should blank out that private key though ASAP.. |
It just an key from other example. |
You can also using the example from your bitcoinjs website. var bitcoin = require('bitcoinjs-lib')
var keyPair = bitcoin.ECPair.fromWIF('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy')
var tx = new bitcoin.TransactionBuilder()
var tx = new bitcoin.TransactionBuilder()
// Add the input (who is paying):
// [previous transaction hash, index of the output to use]
var txId = 'aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31'
tx.addInput(txId, 0)
// Add the output (who to pay to):
// [payee's address, amount in satoshis]
tx.addOutput("1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK", 15000)
// Initialize a private key using WIF
var privateKeyWIF = 'L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy'
var keyPair = bitcoin.ECPair.fromWIF(privateKeyWIF)
// Sign the first input with the new key
tx.sign(0, keyPair)
// Print transaction serialized as hex
console.log(tx.build().toHex()) then broadcast using https://blockchain.info/pushtx or bitpay,you will see the error |
@EasonWang01 can you post the |
Just run the code above as same as on bitcoinjs website example,will got the following hex.
https://blockchain.info/pushtx will cause error. |
I get The inputs aren't in the UTXO, so it makes sense as an error. Maybe your previous error was using a different backend and they therefore had more information? I don't think this is an unexpected result. |
I found the error only happened when using blockchain.info,so not related to bitcoinjs lib. |
When broadcast transaction using bitcoinjs signed transaction will result the error code
but if I using some exist TXhex from blockchain.info it can success broadcast.
I thought it's about the version?
The text was updated successfully, but these errors were encountered: