Skip to content

Commit 93606b2

Browse files
committed
Add a minimum delay of 0.5 seconds to the rpc wait
1 parent 64a9943 commit 93606b2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pxsol/rpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pxsol.rate
66
import random
77
import requests
8+
import time
89
import typing
910

1011
# Doc: https://solana.com/docs/rpc/http
@@ -31,6 +32,7 @@ def wait(sigs: typing.List[str]) -> None:
3132
remain = sigs.copy()
3233
for _ in itertools.repeat(0):
3334
pxsol.log.debugln(f'pxsol: transaction wait unconfirmed={len(remain)}')
35+
time.sleep(max(0.5, 1 / pxsol.config.current.rpc.qps))
3436
if len(remain) == 0:
3537
break
3638
oldest = remain[:256]

0 commit comments

Comments
 (0)