fix broadcasting
This commit is contained in:
parent
7c1860117e
commit
3b0d95b690
3
app.js
3
app.js
|
@ -199,6 +199,7 @@ router.post('/v1/txproposals/:id/signatures/', function(req, res) {
|
|||
req.body.txProposalId = req.params['id'];
|
||||
server.signTx(req.body, function(err, txp) {
|
||||
if (err) return returnError(err, res, req);
|
||||
res.json(txp);
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
|
@ -210,6 +211,7 @@ router.post('/v1/txproposals/:id/broadcast/', function(req, res) {
|
|||
req.body.txProposalId = req.params['id'];
|
||||
server.broadcastTx(req.body, function(err, txp) {
|
||||
if (err) return returnError(err, res, req);
|
||||
res.json(txp);
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
|
@ -220,6 +222,7 @@ router.post('/v1/txproposals/:id/rejections', function(req, res) {
|
|||
req.body.txProposalId = req.params['id'];
|
||||
server.rejectTx(req.body, function(err, txp) {
|
||||
if (err) return returnError(err, res, req);
|
||||
res.json(txp);
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -25,6 +25,7 @@ client.getTxProposals({}, function(err, txps) {
|
|||
var txp = utils.findOneTxProposal(txps, txpid);
|
||||
client.broadcastTxProposal(txp, function(err, txid) {
|
||||
utils.die(err);
|
||||
console.log('TX Broadcasted: ', txid);
|
||||
console.log('Transaction Broadcasted: TXID: ' + x.txid);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -23,6 +23,9 @@ client.getTxProposals({}, function(err, txps) {
|
|||
var txp = utils.findOneTxProposal(txps, txpid);
|
||||
client.rejectTxProposal(txp, reason, function(err, tx) {
|
||||
utils.die(err);
|
||||
console.log('Transaction rejected.');
|
||||
if (x.status == 'rejected')
|
||||
console.log('Transaction finally rejected.');
|
||||
else
|
||||
console.log('Transaction rejected by you.');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,6 +21,9 @@ client.getTxProposals({}, function(err, txps) {
|
|||
var txp = utils.findOneTxProposal(txps, txpid);
|
||||
client.signTxProposal(txp, function(err, x) {
|
||||
utils.die(err);
|
||||
console.log('Transaction signed.');
|
||||
if (x.status == 'broadcasted')
|
||||
console.log('Transaction Broadcasted: TXID: ' + x.txid);
|
||||
else
|
||||
console.log('Transaction signed by you.');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -650,6 +650,7 @@ CopayServer.prototype.signTx = function(opts, cb) {
|
|||
txid: txid
|
||||
});
|
||||
|
||||
console.log('[server.js.653:txp:]',txp); //TODO
|
||||
return cb(null, txp);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue