Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in "lookupBlock(...)" function #2

Closed
BorMor opened this issue Jan 30, 2022 · 1 comment
Closed

Bug in "lookupBlock(...)" function #2

BorMor opened this issue Jan 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@BorMor
Copy link

BorMor commented Jan 30, 2022

async def lookupBlock(self, workchain, shard, seqno=None, lt=None, unixtime=None):
    assert seqno or lt or unixtime, "Seqno, LT or unixtime should be defined"
    mode = 0
    if seqno:
        mode += 1
    if lt:
        mode += 2
     if unixtime:
        mode += 3 <<<<< THERE

It have to be

    if unixtime:
        mode += 4

Related code from litesever.cpp

void LiteQuery::perform_lookupBlock(BlockId blkid, int mode, LogicalTime lt, UnixTime utime) {
  if (!((1 << (mode & 7)) & 0x16)) {
    fatal_error("exactly one of mode.0, mode.1 and mode.2 bits must be set");
    return;
  }
  if (!(mode & 2)) {
    lt = 0;
  }
  if (!(mode & 4)) {
    utime = 0;
  }
@kdimentionaltree kdimentionaltree added the bug Something isn't working label Feb 2, 2022
@dungeon-master-666
Copy link
Collaborator

Nice find, thanks! Fixed in PR #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants