Adding option mempool in /addrs API
/addrs/<addrs>/txs API now supports option mempool. Available values for mempool option: - true: [DEFAULT] query from mempool and blocks (ie, confirmed and unconfirmed tx) - false: do not query from mempool. (ie, confirmed tx only) - only: query only from mempool (ie, unconfirmed tx only)
This commit is contained in:
parent
503eaf70cf
commit
f63922b84e
@ -298,6 +298,21 @@ AddressController.prototype.multitxs = function(req, res) {
|
||||
|
||||
options.after = req.query.after || req.body.after || undefined;
|
||||
|
||||
//mempool options
|
||||
if(!_.isUndefined(req.query.mempool) || !_.isUndefined(req.body.mempool)){
|
||||
var mempool = !_.isUndefined(req.query.mempool) ? req.query.mempool : req.body.mempool;
|
||||
if(mempool == 'true') { //DEFAULT config in query fn
|
||||
options.mempoolOnly = false;
|
||||
options.queryMempool = true;
|
||||
} else if(mempool == 'false') {
|
||||
options.mempoolOnly = false;
|
||||
options.queryMempool = false;
|
||||
} else if(mempool == 'only') {
|
||||
options.mempoolOnly = true;
|
||||
options.queryMempool = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Temporary support
|
||||
if(req.query.from || req.body.from) {
|
||||
options.from = parseInt(req.query.from) || parseInt(req.body.from) || undefined;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user