Giter Site home page Giter Site logo

Comments (7)

xssnick avatar xssnick commented on August 27, 2024 1

Hi, wallet already has method SendManyGetInMsgHash, it will return message hash immediately after sending. Wallet also has FindTransactionByInMsgHash method, with allows you to wait confirmation by msg hash.

If you want to get message hash for manual external message sending you could do like that:

msg := &tlb.ExternalMessage{
    DstAddr: addr,
    Body:    data,
}
hash := msg.Body.Hash()

api.SendExternalMessage(ctx, msg)

from tonutils-go.

akme avatar akme commented on August 27, 2024

Oh, that's interesting, thank you for clarification, will try your approach.

from tonutils-go.

akme avatar akme commented on August 27, 2024

Hey there!
Unfortunately, we found out that this approach doesn't work well in some cases.
It works well for withdrawals confirmation, but we can't use it for "move to hot" actions with contract destruction, because we don't provide any amount and it's calculated on the node side.
I'm wondering if sendMessageReturnHash could help with such issues by providing hash calculated by node for further confirmation checks.

from tonutils-go.

xssnick avatar xssnick commented on August 27, 2024

Hey, have you tried to use 128 + 32 send mode with 0 in amount? I think msg hash should match for that

from tonutils-go.

akme avatar akme commented on August 27, 2024

We are doing exactly this, but no hashes are matching, is there any chance that for V3R1 hashes should be calculated differently?

from tonutils-go.

xssnick avatar xssnick commented on August 27, 2024

No, hashes for v3r1 should be same, i will check this case later

from tonutils-go.

xssnick avatar xssnick commented on August 27, 2024

I researched this case and did some tests. The problem is actually not with message hash, but with account destruction (32 msg mode). When account is destroyed - liteserver drops account's transaction history, so we cannot find transaction. LS is doing it because after next activation, transaction chain cannot be proven using list transactions, each transaction should have reference on previous one, but destroying is breaking this chain.

So the solution is simple, just use 128 without + 32, then account keeps active without balance for some time and will be frozen automatically later.

from tonutils-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.