http: fix tx/address and broadcast routes.

This commit is contained in:
Christopher Jeffrey 2017-04-30 06:06:53 -07:00
parent c1d7e93477
commit a5520abaae
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -250,7 +250,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
var result = [];
var i, metas, meta, view;
enforce(req.options.address, 'Address is required.');
enforce(address, 'Address is required.');
enforce(!this.chain.options.spv, 'Cannot get TX in SPV mode.');
metas = yield this.node.getMetaByAddress(address);
@ -315,7 +315,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
var valid = req.valid();
var tx = valid.buf('tx');
enforce(tx, 'TX is required.');
yield this.node.sendTX(req.options.tx);
yield this.node.sendTX(tx);
res.send(200, { success: true });
}));