MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / updateState

Method updateState

worker/chainbusservice.go:85–105  ·  view source on GitHub ↗
(count uint32, profiles []*types.SQLChainProfile)

Source from the content-addressed store, hash-verified

83}
84
85func (bs *BusService) updateState(count uint32, profiles []*types.SQLChainProfile) {
86 bs.lock.Lock()
87 defer bs.lock.Unlock()
88 var (
89 rebuilt = make(map[proto.DatabaseID]*types.SQLChainProfile)
90 sqlchainState = make(map[proto.DatabaseID]map[proto.AccountAddress]*types.PermStat)
91 )
92 for _, v := range profiles {
93 rebuilt[v.ID] = v
94 sqlchainState[v.ID] = make(map[proto.AccountAddress]*types.PermStat)
95 for _, user := range v.Users {
96 sqlchainState[v.ID][user.Address] = &types.PermStat{
97 Permission: user.Permission,
98 Status: user.Status,
99 }
100 }
101 }
102 atomic.StoreUint32(&bs.blockCount, count)
103 bs.sqlChainProfiles = rebuilt
104 bs.sqlChainState = sqlchainState
105}
106
107func (bs *BusService) subscribeBlock(ctx context.Context) {
108 defer bs.wg.Done()

Callers 2

NewBusServiceFunction · 0.95
subscribeBlockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected