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

Function GetAllNodeID

crypto/kms/pubkeystore.go:216–244  ·  view source on GitHub ↗

GetAllNodeID get all node ids exist in store.

()

Source from the content-addressed store, hash-verified

214
215// GetAllNodeID get all node ids exist in store.
216func GetAllNodeID() (nodeIDs []proto.NodeID, err error) {
217 if pks == nil || pks.db == nil {
218 return nil, ErrPKSNotInitialized
219 }
220
221 if err = func() (err error) {
222 var rows *sql.Rows
223 if rows, err = pks.db.Writer().Query(getAllNodeIDSQL); err != nil {
224 return
225 }
226
227 defer rows.Close()
228
229 for rows.Next() {
230 var rawNodeID string
231 if err = rows.Scan(&rawNodeID); err != nil {
232 return
233 }
234
235 nodeIDs = append(nodeIDs, proto.NodeID(rawNodeID))
236 }
237
238 return
239 }(); err != nil {
240 err = errors.Wrap(err, "get all node id failed")
241 }
242 return
243
244}
245
246// SetPublicKey verifies nonce and set Public Key.
247func SetPublicKey(id proto.NodeID, nonce mine.Uint256, publicKey *asymmetric.PublicKey) (err error) {

Callers 2

GetAllNodeInfoMethod · 0.92
TestDBFunction · 0.85

Calls 6

NodeIDTypeAlias · 0.92
QueryMethod · 0.65
WriterMethod · 0.65
CloseMethod · 0.65
NextMethod · 0.45
ScanMethod · 0.45

Tested by 1

TestDBFunction · 0.68