-
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
Provide better feedback when Transaction is not fully signed #1076
Comments
I thought |
Hmm, we need better checks on After doing: var bitcore = require('bitcore');
var tx = bitcore.Transaction('0100000004675f813a8a3bdfcfefc76db024b3c31b41fdec0e8c44cdac5d933b067ae3a045000000006a473044022072c9f556d7116157b208c6774f7f2f0698a29c567c1d82ba0e4b27d31af5bc8c022033a340c0f051ca72bd9fbce8b9156d2ef6e280cf05bce5bfe05ce840ebf7f4bf01210364ca17e9a443f775d3a26cd8e4f4873c7186c481fb741ec5e66b1c9b8571b3c8ffffffff185f22601506eda04d65643a94cb0f1d6ff0350a9c75950d1f80f48f157f0eab0000000000ffffffff9a14bd3b132e84408ded7a2a96f1fa76ed3ec03900673b87abe53161aa3cacfa0000000000ffffffff6928d19b1e902207fb4c8707a7af3ad4c97c70f7c4041255a9682427807392e70100000000ffffffff0280969800000000001976a9142f1b6a429396647d29cfc7254422e0e16740810788ac30a99e00000000001976a914689eea5c9eb3c296af083cb1c7dbdfce0386d11388ac00000000');
console.log(tx.toJSON()); I'm getting (only the first input is signed): {
"version": 1,
"inputs": [
{
"prevTxId": "45a0e37a063b935daccd448c0eecfd411bc3b324b06dc7efcfdf3b8a3a815f67",
"outputIndex": 0,
"sequenceNumber": 4294967295,
"script": "71 0x3044022072c9f556d7116157b208c6774f7f2f0698a29c567c1d82ba0e4b27d31af5bc8c022033a340c0f051ca72bd9fbce8b9156d2ef6e280cf05bce5bfe05ce840ebf7f4bf01 33 0x0364ca17e9a443f775d3a26cd8e4f4873c7186c481fb741ec5e66b1c9b8571b3c8"
},
{
"prevTxId": "ab0e7f158ff4801f0d95759c0a35f06f1d0fcb943a64654da0ed061560225f18",
"outputIndex": 0,
"sequenceNumber": 4294967295,
"script": ""
},
{
"prevTxId": "faac3caa6131e5ab873b670039c03eed76faf1962a7aed8d40842e133bbd149a",
"outputIndex": 0,
"sequenceNumber": 4294967295,
"script": ""
},
{
"prevTxId": "e7927380272468a9551204c4f7707cc9d43aafa707874cfb0722901e9bd12869",
"outputIndex": 1,
"sequenceNumber": 4294967295,
"script": ""
}
],
"outputs": [
{
"satoshis": 10000000,
"script": "OP_DUP OP_HASH160 20 0x2f1b6a429396647d29cfc7254422e0e167408107 OP_EQUALVERIFY OP_CHECKSIG"
},
{
"satoshis": 10398000,
"script": "OP_DUP OP_HASH160 20 0x689eea5c9eb3c296af083cb1c7dbdfce0386d113 OP_EQUALVERIFY OP_CHECKSIG"
}
],
"nLockTime": 0
} |
Thanks! So it seems the main problem is not having clear error messages. I already filed the other bug about it trying to parse the error message but probably more can be done to make it clear and to do earlier checks? |
Thanks for trying out the library. Your feedback helps us improve the API towards becoming the most usable library out there. I'll cross reference these current issues:
|
It's fun to try it out and was pretty easy until I ran into this problem. |
@dskloet thanks a lot for finding this! we'll fix it shortly and report back |
Related? bitpay/bitcore-explorers#20 |
This is now reporting an error before broadcasting, as reported in bitpay/bitcore-explorers#20
|
Instantiating an instance of Transaction from a hexa serialized version is also causing other problems/confusion: #1199 |
|
I got this error when I was trying to sign with a wrong secret key. |
I'm trying to broadcast a transaction but I keep getting this meaningless error in the broadcast callback, for what I think is a perfectly fine transaction. How can I debug this error? Here's the code that gives the error:
The text was updated successfully, but these errors were encountered: