Skip to content

can't broadcast serialized transaction #20

@maraoz

Description

@maraoz

the following code results in an error:

'use strict';

var bitcore = require('bitcore');
var explorers = require('bitcore-explorers');
var insight = new explorers.Insight();

var Transaction = bitcore.Transaction;

var tx = new Transaction('0100000001c54cd2b468b0a0e24f573ee10bedfd7500c7079bf98c1ec7d56b330147d6f188000000006b48304502210091126306c144d97b7c811f0d7db535ae8ce709739b87ed2afda23418429adcb602202fe57542741477f02d4d42d3050dc71975840dff74c20ebbfcc6ca1773a044fd012102b9740162829af19408920ad4111298b98795b911d37514d975ac1912578545fcffffffff02074c0f00000000001976a9145ffd525ef01e229497e56b189fdd2a42bd36ba6688ace96de605000000001976a9145ffd525ef01e229497e56b189fdd2a42bd36ba6688ac00000000');
console.log(tx);
insight.broadcast(tx, function(err, txid) {
  if (err) {
    throw err;
  }
  console.log(txid);
});

and...

$ node broadcast.js 
<Transaction: 0100000001c54cd2b468b0a0e24f573ee10bedfd7500c7079bf98c1ec7d56b330147d6f188000000006b48304502210091126306c144d97b7c811f0d7db535ae8ce709739b87ed2afda23418429adcb602202fe57542741477f02d4d42d3050dc71975840dff74c20ebbfcc6ca1773a044fd012102b9740162829af19408920ad4111298b98795b911d37514d975ac1912578545fcffffffff02074c0f00000000001976a9145ffd525ef01e229497e56b189fdd2a42bd36ba6688ace96de605000000001976a9145ffd525ef01e229497e56b189fdd2a42bd36ba6688ac00000000>

/home/maraoz/git/segments/node_modules/bitcore/lib/transaction/transaction.js:723
        throw new errors.Transaction.Input.MissingPreviousOutput();
              ^
No previous output information.

Should work for an already serialized transaction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions