Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions packages/neuron-wallet/src/services/asset-account-service.ts
Comment thread
WhiteMinds marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,23 @@ export default class AssetAccountService {
.values(sudtTokenInfoEntity)
.onConflict(`("tokenID") DO NOTHING`)
.execute()

await getConnection()
const existAccountAcount = await getConnection()
.getRepository(AssetAccountEntity)
.createQueryBuilder()
.insert()
.into(AssetAccountEntity)
.values(assetAccountEntity)
.onConflict(`("tokenID", "blake160") DO NOTHING`)
.execute()
.where({
tokenID,
blake160
})
.getCount()
// check whether the entity exists before insert. Reason: https://github.com/Magickbase/neuron-public-issues/issues/184#issue-1749746997
if (!existAccountAcount) {
await getConnection()
.createQueryBuilder()
.insert()
.into(AssetAccountEntity)
.values(assetAccountEntity)
.execute()
Comment thread
WhiteMinds marked this conversation as resolved.
}
}

public static async checkAndDeleteWhenFork(startBlockNumber: string, anyoneCanPayLockHashes: string[]) {
Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/src/services/multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export default class MultisigService {
const config = currentMultisigConfigs[idx]
const script = Multisig.getMultisigScript(config.blake160s, config.r, config.m, config.n)
addressCursorMap.set(script.args, v?.result?.last_cursor)
v.result.objects.forEach((transaction: any) => {
multisigOutputTxHashList.add(transaction.tx_hash)
v.result.objects.forEach((obj: any) => {
multisigOutputTxHashList.add(obj.tx_hash || obj.transaction?.hash)
})
nextMultisigConfigs.push(currentMultisigConfigs[idx])
}
Expand Down