HathorNetwork / hathor-wallet-service-old

MIT License
4 stars 4 forks source link

fix: using the latest block timestamp to detect if we have voided mem… #406

Closed andreabadesso closed 1 year ago

andreabadesso commented 1 year ago

Fixes https://github.com/HathorNetwork/on-call-incidents/issues/102

Explanation

Currently, to detect transactions that got voided before getting confirmed by a block, we run a cronjob every 20 minutes to check if we have transactions without height on the database, if we do, we query the fullnode to check if it's really voided.

Since we are having larger block times because of the volatile hashrate on our mainnet, transactions are taking more than 20 minutes to get confirmed by a block and this is triggering alerts (false positives).

I changed it to check all transactions 20 minutes older than the latest block timestamp.

Acceptance Criteria

Security Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #406 (a5a1640) into dev (469dcc7) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #406      +/-   ##
==========================================
+ Coverage   95.52%   95.53%   +0.01%     
==========================================
  Files          40       40              
  Lines        2412     2418       +6     
  Branches      270      271       +1     
==========================================
+ Hits         2304     2310       +6     
  Misses        108      108              
Impacted Files Coverage Δ
src/types.ts 98.65% <ø> (ø)
src/db/index.ts 99.66% <100.00%> (+<0.01%) :arrow_up:
src/mempool.ts 93.33% <100.00%> (+0.22%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.