MCPcopy
hub / github.com/gitcoinco/web / addSafe

Method addSafe

app/assets/v2/js/ipfs-api.js:48211–48224  ·  view source on GitHub ↗
(ma)

Source from the content-addressed store, hash-verified

48209 // they are completely worthless for all the other peers. This method is
48210 // exclusively used by identify.
48211 addSafe (ma) {
48212 ma = ensureMultiaddr(ma)
48213
48214 const check = this._observedMultiaddrs.some((m, i) => {
48215 if (m.equals(ma)) {
48216 this.add(ma)
48217 this._observedMultiaddrs.splice(i, 1)
48218 return true
48219 }
48220 })
48221 if (!check) {
48222 this._observedMultiaddrs.push(ma)
48223 }
48224 }
48225
48226 toArray () {
48227 return this._multiaddrs.slice()

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
ensureMultiaddrFunction · 0.85
equalsMethod · 0.45

Tested by

no test coverage detected