- Save all transactions and Events that go to Dao contracts in a
allTransactionsdatabase, in chronological order:
{
index: <index of transaction, starting from 0>
tx: {txObject}
txReceipt: {txReceipt object}
decodedInput:
decodedEvents:
}
-
There is a function
updateTransactionDatabasethat will updateallTransactionsto 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+1tocurrentBlock, and add all the DAO transactions toallTransactions
- get the last transaction from
-
There is a
watchNewBlocksthat watches new blocks and callupdateTransactionDatabase -
There is a variable
lastProcessedTransactionthat is initialized to be -1 (not processed anything yet) -
There is a function
processTransactionsthat will process the new transactions since thelastProcessedTransaction, to be called afterwatchNewBlocksis done adding new tnxs- For each tnx, do a
processTnx(tnxObjectFromDb)
- For each tnx, do a