Skip to content

Commit

Permalink
Merge pull request #140 from xssnick/fix-race-curmastinfo
Browse files Browse the repository at this point in the history
Fixed CurrentMasterchainInfo race & payment channel close struct
  • Loading branch information
xssnick committed Oct 17, 2023
2 parents 0556e91 + a9a898f commit a7f4ad3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img align="right" width="425px" src="https://github.com/xssnick/props/blob/master/logoimg.png?raw=true">

[![Based on TON][ton-svg]][ton]
![Coverage](https://img.shields.io/badge/Coverage-73.4%25-brightgreen)
![Coverage](https://img.shields.io/badge/Coverage-73.3%25-brightgreen)

Golang library for interacting with TON blockchain.

Expand Down
4 changes: 2 additions & 2 deletions ton/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ func (c *APIClient) CurrentMasterchainInfo(ctx context.Context) (_ *BlockIDExt,
// if not sticky - id will be 0
nodeID := c.client.StickyNodeID(ctx)

root.curMastersLock.RLock()
root.curMastersLock.Lock()
master := root.curMasters[nodeID]
if master == nil {
master = &masterInfo{}
root.curMasters[nodeID] = master
}
root.curMastersLock.RUnlock()
root.curMastersLock.Unlock()

master.mx.Lock()
defer master.mx.Unlock()
Expand Down
1 change: 0 additions & 1 deletion ton/payments/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ type TopupBalance struct {

type CooperativeClose struct {
_ tlb.Magic `tlb:"#5577587e"`
IsA bool `tlb:"bool"`
SignatureA Signature `tlb:"^"`
SignatureB Signature `tlb:"^"`
Signed struct {
Expand Down

0 comments on commit a7f4ad3

Please sign in to comment.