MCPcopy Create free account
hub / github.com/DOSNetwork/core / UnRegisterNode

Method UnRegisterNode

onchain/eth_set.go:273–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271}
272
273func (e *ethAdaptor) UnRegisterNode() (err error) {
274 if !e.isConnecting() {
275 err = errors.New("[ONCHAIN] not connecting to geth")
276 return
277 }
278
279 // define how to parse parameters and execute proxy function
280 opCtx, opCancel := context.WithTimeout(e.ctx, e.setTimeout)
281 defer opCancel()
282 proxies := e.proxies
283
284 f := func(ctx context.Context) (tx *types.Transaction, err error) {
285 idx := getIndex(ctx)
286 if idx == -1 {
287 err = errors.New("no client index in context")
288 } else {
289 tx, err = proxies[idx].UnregisterNode()
290 if err != nil {
291 err = &OnchainError{err: errors.Errorf(": %w", err), Idx: idx}
292 } else {
293 e.logger.Info(fmt.Sprintf("UnRegisterNode %x", tx.Hash()))
294 }
295 }
296 if err != nil {
297 e.logger.Error(err)
298 }
299 return
300 }
301 return e.waitForReply(&request{opCtx: opCtx, f: f, reply: make(chan *response)})
302}
303
304func (e *ethAdaptor) SignalRandom() (err error) {
305 if !e.isConnecting() {

Callers

nothing calls this directly

Calls 8

isConnectingMethod · 0.95
waitForReplyMethod · 0.95
getIndexFunction · 0.85
NewMethod · 0.65
InfoMethod · 0.65
ErrorMethod · 0.65
UnregisterNodeMethod · 0.45
HashMethod · 0.45

Tested by

no test coverage detected