File tree Expand file tree Collapse file tree
packages/neuron-wallet/src/services/sync/check-and-save Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default class CheckTx {
1717 }
1818
1919 public check = async ( lockHashes : string [ ] ) : Promise < string [ ] > => {
20- const outputs : Cell [ ] = this . filterOutputs ( lockHashes )
20+ const outputs : Cell [ ] = await this . filterOutputs ( lockHashes )
2121 const inputAddresses = await this . filterInputs ( lockHashes )
2222
2323 const outputAddresses : string [ ] = outputs . map ( output => {
@@ -39,12 +39,17 @@ export default class CheckTx {
3939 return false
4040 }
4141
42- public filterOutputs = ( lockHashes : string [ ] ) => {
43- const cells : Cell [ ] = this . tx . outputs ! . filter ( async output => {
44- const checkOutput = new CheckOutput ( output )
45- const result = await checkOutput . checkLockHash ( lockHashes )
46- return result
47- } )
42+ public filterOutputs = async ( lockHashes : string [ ] ) => {
43+ const cells : Cell [ ] = ( await Promise . all (
44+ this . tx . outputs ! . map ( async output => {
45+ const checkOutput = new CheckOutput ( output )
46+ const result = await checkOutput . checkLockHash ( lockHashes )
47+ if ( result ) {
48+ return output
49+ }
50+ return false
51+ } )
52+ ) ) . filter ( cell => ! ! cell ) as Cell [ ]
4853 return cells
4954 }
5055
You can’t perform that action at this time.
0 commit comments