retry and validate handshake address
This commit is contained in:
parent
1df3d685c7
commit
0df700000b
1 changed files with 14 additions and 5 deletions
|
|
@ -515,11 +515,20 @@ const sendHandshakeRequest = async (recipientPublicKey, gun, user, SEA) => {
|
||||||
|
|
||||||
logger.info('sendHR() -> before currentHandshakeAddress')
|
logger.info('sendHR() -> before currentHandshakeAddress')
|
||||||
|
|
||||||
const currentHandshakeAddress = await Utils.tryAndWait(gun =>
|
const currentHandshakeAddress = await Utils.tryAndWait(
|
||||||
gun
|
gun =>
|
||||||
.user(recipientPublicKey)
|
Common.Utils.makePromise(res => {
|
||||||
.get(Key.CURRENT_HANDSHAKE_ADDRESS)
|
gun
|
||||||
.then()
|
.user(recipientPublicKey)
|
||||||
|
.get(Key.CURRENT_HANDSHAKE_ADDRESS)
|
||||||
|
.once(
|
||||||
|
data => {
|
||||||
|
res(data)
|
||||||
|
},
|
||||||
|
{ wait: 1000 }
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
data => typeof data !== 'string'
|
||||||
)
|
)
|
||||||
|
|
||||||
if (typeof currentHandshakeAddress !== 'string') {
|
if (typeof currentHandshakeAddress !== 'string') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue