thecointech / thecoin

Mono-repo for TheCoin project
https://thecoin.io
GNU Affero General Public License v3.0
3 stars 1 forks source link

UberBill: Fix graph to skip ClearPending if tx has completed #525

Open FrozenKiwi opened 4 months ago

FrozenKiwi commented 4 months ago

Currently, uber-bill graph is not a graph, so even if initial uberDepositCoin finishes immediately, it will still execute uberClearPending, and an associated waitCoin

These actions are unnecessary and potentially harmful. Currenlty, they are skipped by:

  // If we already have a coin balance, it may be that the original
  // UberTransfer completed immediately.  In this case, there is no need to do anything
  if (container.action.data.coin?.isPositive()) {
    return {};
  }

and in waitCoin, return {} on no hash