Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected fromSatoshi(satoshi) {
return Utils.formatSatoshi(satoshi);
}
app.resolvePlugin("logger").debug(
`Transaction ${id} not eligible to enter pool - fee of ${Utils.formatSatoshi(
fee,
)} is smaller than minimum fee (${Utils.formatSatoshi(minFeePool)})`,
);
}
} else {
const staticFee: Utils.BigNumber = Managers.feeManager.getForTransaction(transaction.data);
if (fee.isEqualTo(staticFee)) {
broadcast = true;
enterPool = true;
app.resolvePlugin("logger").debug(
`Transaction ${id} eligible for broadcast and to enter pool - fee of ${Utils.formatSatoshi(
fee,
)} is equal to static fee (${Utils.formatSatoshi(staticFee)})`,
);
} else {
broadcast = false;
enterPool = false;
app.resolvePlugin("logger").debug(
`Transaction ${id} not eligible for broadcast and not eligible to enter pool - fee of ${Utils.formatSatoshi(
fee,
)} does not match static fee (${Utils.formatSatoshi(staticFee)})`,
);
}
}
return { broadcast, enterPool };
`Transaction ${id} not eligible to enter pool - fee of ${Utils.formatSatoshi(
fee,
)} is smaller than minimum fee (${Utils.formatSatoshi(minFeePool)})`,
);
}
} else {
const staticFee: Utils.BigNumber = Managers.feeManager.getForTransaction(transaction.data);
if (fee.isEqualTo(staticFee)) {
broadcast = true;
enterPool = true;
app.resolvePlugin("logger").debug(
`Transaction ${id} eligible for broadcast and to enter pool - fee of ${Utils.formatSatoshi(
fee,
)} is equal to static fee (${Utils.formatSatoshi(staticFee)})`,
);
} else {
broadcast = false;
enterPool = false;
app.resolvePlugin("logger").debug(
`Transaction ${id} not eligible for broadcast and not eligible to enter pool - fee of ${Utils.formatSatoshi(
fee,
)} does not match static fee (${Utils.formatSatoshi(staticFee)})`,
);
}
}
return { broadcast, enterPool };
};
const { dynamicFees } = app.resolveOptions("transaction-pool");
let broadcast: boolean;
let enterPool: boolean;
if (dynamicFees.enabled) {
const minFeeBroadcast: Utils.BigNumber = calculateMinimumFee(dynamicFees.minFeeBroadcast, transaction);
if (fee.isGreaterThanOrEqualTo(minFeeBroadcast)) {
broadcast = true;
app.resolvePlugin("logger").debug(
`Transaction ${id} eligible for broadcast - fee of ${Utils.formatSatoshi(fee)} is ${
fee.isEqualTo(minFeeBroadcast) ? "equal to" : "greater than"
} minimum fee (${Utils.formatSatoshi(minFeeBroadcast)})`,
);
} else {
broadcast = false;
app.resolvePlugin("logger").debug(
`Transaction ${id} not eligible for broadcast - fee of ${Utils.formatSatoshi(
fee,
)} is smaller than minimum fee (${Utils.formatSatoshi(minFeeBroadcast)})`,
);
}
const minFeePool: Utils.BigNumber = calculateMinimumFee(dynamicFees.minFeePool, transaction);
if (fee.isGreaterThanOrEqualTo(minFeePool)) {
enterPool = true;
return { round: roundInfo ? roundInfo.round : 0, ...delegate, rate };
});
if (roundInfo) {
delegateWallets = delegateWallets.slice(0, roundInfo.maxDelegates);
for (const [voteBalance, set] of equalVotesMap.entries()) {
const values: any[] = Array.from(set.values());
if (delegateWallets.includes(values[0])) {
const mapped = values.map(v => `${v.username} (${v.publicKey})`);
this.logger.warn(
`Delegates ${JSON.stringify(
mapped,
undefined,
4,
)} have a matching vote balance of ${Utils.formatSatoshi(voteBalance)}`,
);
}
}
}
return delegateWallets;
}