@@ -76,6 +76,7 @@ Bitcoin.DEFAULT_TRY_ALL_INTERVAL = 1000;
76
76
Bitcoin . DEFAULT_REINDEX_INTERVAL = 10000 ;
77
77
Bitcoin . DEFAULT_START_RETRY_INTERVAL = 5000 ;
78
78
Bitcoin . DEFAULT_TIP_UPDATE_INTERVAL = 15000 ;
79
+ Bitcoin . DEFAULT_TRANSACTION_CONCURRENCY = 5 ;
79
80
Bitcoin . DEFAULT_CONFIG_SETTINGS = {
80
81
server : 1 ,
81
82
whitelist : '127.0.0.1' ,
@@ -92,6 +93,8 @@ Bitcoin.DEFAULT_CONFIG_SETTINGS = {
92
93
} ;
93
94
94
95
Bitcoin . prototype . _initDefaults = function ( options ) {
96
+ /* jshint maxcomplexity: 15 */
97
+
95
98
// limits
96
99
this . maxTxids = options . maxTxids || Bitcoin . DEFAULT_MAX_TXIDS ;
97
100
this . maxTransactionHistory = options . maxTransactionHistory || Bitcoin . DEFAULT_MAX_HISTORY ;
@@ -106,6 +109,9 @@ Bitcoin.prototype._initDefaults = function(options) {
106
109
this . tryAllInterval = options . tryAllInterval || Bitcoin . DEFAULT_TRY_ALL_INTERVAL ;
107
110
this . startRetryInterval = options . startRetryInterval || Bitcoin . DEFAULT_START_RETRY_INTERVAL ;
108
111
112
+ // rpc limits
113
+ this . transactionConcurrency = options . transactionConcurrency || Bitcoin . DEFAULT_TRANSACTION_CONCURRENCY ;
114
+
109
115
// sync progress level when zmq subscribes to events
110
116
this . zmqSubscribeProgress = options . zmqSubscribeProgress || Bitcoin . DEFAULT_ZMQ_SUBSCRIBE_PROGRESS ;
111
117
} ;
@@ -1412,8 +1418,9 @@ Bitcoin.prototype.getAddressHistory = function(addressArg, options, callback) {
1412
1418
return callback ( e ) ;
1413
1419
}
1414
1420
1415
- async . mapSeries (
1421
+ async . mapLimit (
1416
1422
txids ,
1423
+ self . transactionConcurrency ,
1417
1424
function ( txid , next ) {
1418
1425
self . _getAddressDetailedTransaction ( txid , {
1419
1426
queryMempool : queryMempool ,
0 commit comments