klaim: reward tak terukur ⊖ pernah jadi sukses-0 (V55/B17): _measure_reward retry reward_from_tx 4x dgn SETTLE_SECONDS=30 (tx baru mendarat belum terindeks Hyperion → None palsu) lalu fallback selisih saldo HANYA delta positif (after > before) — delta 0 ambigu (node balik saldo lama) → None → fee pending + alert KLAIM MENDARAT · REWARD TAK TERUKUR, ⊖ notif KLAIM REWARD SUKSES 0.0000 palsu (kasus 8 Agt: klaim 48c2066f reward 1683.3641 tapi app notif 0.0000, fee tak terkirim) ; reward 0 asli dibuktikan dari isi tx (Decimal 0) ; oracle B17-a delta-0 → pending, B17-b catch-up reward asli ; image claim rebuild + push
This commit is contained in:
1 parent
2f043c20bd
commit
ee4682da00
4 files changed
+73
-11
No files matched your search
@@ -34,7 +34,7 @@ from config import (API_NODE, BP_FEE_PERCENT, BP_FEE_WALLET, BP_PRIVATE_KEY,
|
||||
TOKEN_CONTRACT)
|
||||
|
||||
VEX_PREC = Decimal('0.0001')
|
||||
SETTLE_SECONDS = 10 # tunggu finalitas sebelum baca saldo setelah klaim
|
||||
SETTLE_SECONDS = 30 # tunggu finalitas sebelum baca saldo setelah klaim
|
||||
POLL_SPAN_SECONDS = 7200 # batas poll sekali jendela (2 jam)
|
||||
|
||||
|
||||
@@ -183,16 +183,24 @@ def reward_from_tx(txid):
|
||||
|
||||
|
||||
def _measure_reward(txid, before):
|
||||
"""Reward klaim: prioritas isi tx (V45) → fallback selisih saldo.
|
||||
"""Reward klaim: prioritas isi tx (V45) → fallback selisih saldo (V55).
|
||||
|
||||
Return `Decimal` | None bila keduanya gagal (reward tak terukur)."""
|
||||
reward = reward_from_tx(txid)
|
||||
if reward is not None:
|
||||
return reward
|
||||
Return `Decimal` | None bila keduanya gagal (reward tak terukur).
|
||||
V55/B17: `reward_from_tx` di-RETRY dgn jeda settle — tx klaim baru mendarat
|
||||
bisa belum terindeks Hyperion sesaat (None palsu) → beri waktu mengejar.
|
||||
Fallback selisih saldo HANYA mengakui delta POSITIF (after > before) sbg
|
||||
terukur; delta 0 ambigu (node balik saldo lama / saldo belum ter-update) →
|
||||
tetap None → jalur tak-terukur (fee pending + alert), ⊖ sukses-0 palsu.
|
||||
Reward nol asli (tx executed tanpa bpay/vpay) tetap terbaca via isi tx."""
|
||||
for _ in range(4):
|
||||
reward = reward_from_tx(txid)
|
||||
if reward is not None:
|
||||
return reward
|
||||
time.sleep(SETTLE_SECONDS)
|
||||
for _ in range(3):
|
||||
time.sleep(SETTLE_SECONDS)
|
||||
after = dist.fetch_balance()
|
||||
if after is not None:
|
||||
if after is not None and after > before:
|
||||
return max(after - before, Decimal('0'))
|
||||
return None
|
||||
|
||||
|
||||
Reference in new issue
Block a user