http: fix broadcast call.
This commit is contained in:
parent
33c4ede940
commit
8b74d95280
@ -316,9 +316,15 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
// Broadcast TX
|
// Broadcast TX
|
||||||
this.post('/broadcast', async function(req, res) {
|
this.post('/broadcast', async function(req, res) {
|
||||||
var valid = req.valid();
|
var valid = req.valid();
|
||||||
var tx = valid.buf('tx');
|
var raw = valid.buf('tx');
|
||||||
enforce(tx, 'TX is required.');
|
var tx;
|
||||||
|
|
||||||
|
enforce(raw, 'TX is required.');
|
||||||
|
|
||||||
|
tx = TX.fromRaw(raw);
|
||||||
|
|
||||||
await this.node.sendTX(tx);
|
await this.node.sendTX(tx);
|
||||||
|
|
||||||
res.send(200, { success: true });
|
res.send(200, { success: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user