- Save all transactions and Events that go to Dao contracts in a
allTransactions
database, in chronological order:
{
index: <index of transaction, starting from 0>
tx: {txObject}
txReceipt: {txReceipt object}
decodedInput:
decodedEvents:
}
-
There is a function
updateTransactionDatabase
that will updateallTransactions
to the latest block. This is what it should do:- get the last transaction from
allTransactions
, find out which block it is (lets say itslastBlock
) - go through all the blocks from
lastBlock+1
tocurrentBlock
, and add all the DAO transactions toallTransactions
- get the last transaction from
-
There is a
watchNewBlocks
that watches new blocks and callupdateTransactionDatabase
-
There is a variable
lastProcessedTransaction
that is initialized to be -1 (not processed anything yet) -
There is a function
processTransactions
that will process the new transactions since thelastProcessedTransaction
, to be called afterwatchNewBlocks
is done adding new tnxs- For each tnx, do a
processTnx(tnxObjectFromDb)
- For each tnx, do a