Skip to content

Commit

Permalink
Fixing compile issues
Browse files Browse the repository at this point in the history
  • Loading branch information
micahriggan committed Aug 21, 2019
1 parent 0cfddf9 commit 61ddc54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/bitcore-node/src/models/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,8 @@ export class TransactionModel extends BaseModel<ITransaction> {
for (const mintOp of mintOps) {
mintOpsAddresses[mintOp.updateOne.update.$set.address] = true;
}
mintOpsAddresses = Object.keys(mintOpsAddresses);
let wallets = await WalletAddressStorage.collection
.find({ address: { $in: mintOpsAddresses }, chain, network }, { batchSize: 100 })
.find({ address: { $in: Object.keys(mintOpsAddresses) }, chain, network }, { batchSize: 100 })
.project({ wallet: 1, address: 1 })
.toArray();
if (wallets.length) {
Expand Down Expand Up @@ -547,7 +546,7 @@ export class TransactionModel extends BaseModel<ITransaction> {
{ multi: true }
),
CoinStorage.collection.update(
{ chain, network, mintTxid: invalidatedTxids },
{ chain, network, mintTxid: { $in: invalidatedTxids } },
{ $set: { mintHeight: SpentHeightIndicators.conflicting } },
{ multi: true }
)
Expand Down
5 changes: 3 additions & 2 deletions packages/bitcore-node/src/routes/api/fee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ const feeCache = {};

router.get('/:target', CacheMiddleware(CacheTimes.Second), async (req: Request, res: Response) => {
let { target, chain, network } = req.params;
if (target < 0 || target > 100) {
const targetNum = Number(target);
if (targetNum < 0 || targetNum > 100) {
return res.status(400).send('invalid target specified');
}
const cachedFee = feeCache[`${chain}:${network}:${target}`];
if (cachedFee && cachedFee.date > Date.now() - 10 * 1000) {
return res.json(cachedFee.fee);
}
try {
let fee = await ChainStateProvider.getFee({ chain, network, target });
let fee = await ChainStateProvider.getFee({ chain, network, target: targetNum });
if (!fee) {
return res.status(404).send('not available right now');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/bitcore-node/src/routes/api/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const verifyRequestSignature = (params: VerificationPayload): boolean => {
}
};

const authenticate: RequestHandler = async (req: PreAuthRequest, res: Response, next: any) => {
const authenticate: RequestHandler = async (req: Request, res: Response, next: any) => {
const { chain, network, pubKey } = req.params as SignedApiRequest;
logger.debug('Authenticating request with pubKey: ', pubKey);
let wallet;
Expand Down

0 comments on commit 61ddc54

Please sign in to comment.