Exchance transaction for set() in Blockchain

working-state
Garrett Mills 3 years ago
parent 0a512170cc
commit d07feccd14
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -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…
Cancel
Save