Skip to content

fix: Avoid save duplicate blake160 for one wallet#2351

Merged
Keith-CY merged 2 commits intonervosnetwork:developfrom
yanguoyu:avoid-duplicate-blake160s
May 5, 2022
Merged

fix: Avoid save duplicate blake160 for one wallet#2351
Keith-CY merged 2 commits intonervosnetwork:developfrom
yanguoyu:avoid-duplicate-blake160s

Conversation

@yanguoyu
Copy link
Contributor

No description provided.

@Keith-CY
Copy link
Collaborator

Could this check

const exist = await getConnection()
.getRepository(HdPublicKeyInfo)
.createQueryBuilder()
.where({
walletId,
publicKeyInBlake160: publicKeyHash
})
.getRawOne()
if (exist) {
return
}
be removed in this PR?

@yanguoyu
Copy link
Contributor Author

Could this check

const exist = await getConnection()
.getRepository(HdPublicKeyInfo)
.createQueryBuilder()
.where({
walletId,
publicKeyInBlake160: publicKeyHash
})
.getRawOne()
if (exist) {
return
}

be removed in this PR?

This function is saving an address. I think it should be retained

@Keith-CY
Copy link
Collaborator

Could this check

const exist = await getConnection()
.getRepository(HdPublicKeyInfo)
.createQueryBuilder()
.where({
walletId,
publicKeyInBlake160: publicKeyHash
})
.getRawOne()
if (exist) {
return
}

be removed in this PR?

This function is saving an address. I think it should be retained

Gotcha

@Keith-CY Keith-CY requested review from Cedar67, Keith-CY and qiweiii May 5, 2022 01:41
@Keith-CY Keith-CY merged commit ef59ba8 into nervosnetwork:develop May 5, 2022
@Keith-CY Keith-CY mentioned this pull request May 5, 2022
@yanguoyu yanguoyu deleted the avoid-duplicate-blake160s branch June 9, 2022 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants