update pledges commitTime on sync

This commit is contained in:
Barry Gitarts 2019-06-07 11:11:01 -04:00 committed by Barry G
parent 31b2dd0697
commit 1362da59d3
1 changed files with 2 additions and 1 deletions

View File

@ -56,11 +56,12 @@ export const updateStalePledges = async () => {
const batch = stalePledges.map(p => {
const updated = updatedPledges[p.idPledge - 1]
return p.prepareUpdate(p => {
const { amount, nDelegates, pledgeState, blockNumber } = updated
const { amount, nDelegates, pledgeState, blockNumber, commitTime } = updated
p.amount = amount
p.nDelegates = Number(nDelegates)
p.pledgeState = Number(pledgeState)
p.blockNumber = blockNumber
p.commitTime = Number(commitTime)
})
})
database.action(() => database.batch(...batch))