mirror of
				https://github.com/hackku21/loc-chain-backend.git
				synced 2025-06-13 12:53:59 +00:00 
			
		
		
		
	Exchance transaction for set() in Blockchain
This commit is contained in:
		
							parent
							
								
									0a512170cc
								
							
						
					
					
						commit
						d07feccd14
					
				@ -330,7 +330,18 @@ export class Blockchain extends Unit {
 | 
			
		||||
            this.pendingTransactions = []
 | 
			
		||||
            await (<BlockResource>this.app().make(BlockResource)).push(block)
 | 
			
		||||
        } else {
 | 
			
		||||
            await this.firebase.ref('block').transaction((_) => {
 | 
			
		||||
            await this.firebase.ref('block').set((time_x_blocks[min] || []).map(x => {
 | 
			
		||||
                const item = x.toItem()
 | 
			
		||||
                // @ts-ignore
 | 
			
		||||
                delete item.firebaseID
 | 
			
		||||
 | 
			
		||||
                if ( !item.transactions ) {
 | 
			
		||||
                    item.transactions = []
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return item
 | 
			
		||||
            }))
 | 
			
		||||
            /*await this.firebase.ref('block').transaction((_) => {
 | 
			
		||||
                return (time_x_blocks[min] || []).map(x => {
 | 
			
		||||
                    const item = x.toItem()
 | 
			
		||||
                    // @ts-ignore
 | 
			
		||||
@ -342,7 +353,7 @@ export class Blockchain extends Unit {
 | 
			
		||||
 | 
			
		||||
                    return item
 | 
			
		||||
                })
 | 
			
		||||
            })
 | 
			
		||||
            })*/
 | 
			
		||||
 | 
			
		||||
            this.pendingSubmit = undefined
 | 
			
		||||
            await this.attemptSubmit()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user