Merge pull request #422 from mempool/simon/corerpcminfee-catcher
Catch getMempoolInfo errors gracefully to not break general main loop
This commit is contained in:
commit
b0baf6aa0d
@ -14,7 +14,7 @@ class Mempool {
|
|||||||
private inSync: boolean = false;
|
private inSync: boolean = false;
|
||||||
private mempoolCache: { [txId: string]: TransactionExtended } = {};
|
private mempoolCache: { [txId: string]: TransactionExtended } = {};
|
||||||
private mempoolInfo: IBitcoinApi.MempoolInfo = { loaded: false, size: 0, bytes: 0, usage: 0,
|
private mempoolInfo: IBitcoinApi.MempoolInfo = { loaded: false, size: 0, bytes: 0, usage: 0,
|
||||||
maxmempool: 0, mempoolminfee: 0, minrelaytxfee: 0 };
|
maxmempool: 300000000, mempoolminfee: 0.00001000, minrelaytxfee: 0.00001000 };
|
||||||
private mempoolChangedCallback: ((newMempool: {[txId: string]: TransactionExtended; }, newTransactions: TransactionExtended[],
|
private mempoolChangedCallback: ((newMempool: {[txId: string]: TransactionExtended; }, newTransactions: TransactionExtended[],
|
||||||
deletedTransactions: TransactionExtended[]) => void) | undefined;
|
deletedTransactions: TransactionExtended[]) => void) | undefined;
|
||||||
|
|
||||||
|
@ -111,7 +111,16 @@ class Server {
|
|||||||
|
|
||||||
async runMainUpdateLoop() {
|
async runMainUpdateLoop() {
|
||||||
try {
|
try {
|
||||||
await memPool.$updateMemPoolInfo();
|
try {
|
||||||
|
await memPool.$updateMemPoolInfo();
|
||||||
|
} catch (e) {
|
||||||
|
const msg = `updateMempoolInfo: ${(e.message || e)}`;
|
||||||
|
if (config.CORE_RPC_MINFEE.ENABLED) {
|
||||||
|
logger.warn(msg);
|
||||||
|
} else {
|
||||||
|
logger.debug(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
await blocks.$updateBlocks();
|
await blocks.$updateBlocks();
|
||||||
await memPool.$updateMempool();
|
await memPool.$updateMempool();
|
||||||
setTimeout(this.runMainUpdateLoop.bind(this), config.MEMPOOL.POLL_RATE_MS);
|
setTimeout(this.runMainUpdateLoop.bind(this), config.MEMPOOL.POLL_RATE_MS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user