|
6 | 6 | # Guénolé de Cadoudal ([email protected]), Drew Wells ([email protected]) |
7 | 7 | # 2020-2021 ADAMANT Foundation ([email protected]): Aleksei Lebedev |
8 | 8 | # 2017-2020 ADAMANT TECH LABS LP ([email protected]): Artem Brunov, Aleksei Lebedev |
9 | | -# v2.1 |
| 9 | +# v2.4 |
10 | 10 |
|
11 | 11 | from os import environ |
12 | 12 | from web3 import Web3 |
|
58 | 58 | logger.addHandler(lfh) |
59 | 59 |
|
60 | 60 | # Systemd logger, if we want to user journalctl logs |
61 | | -# Install systemd-python and |
| 61 | +# Install systemd-python and |
62 | 62 | # decomment "#from systemd.journal import JournalHandler" up |
63 | 63 | #ljc = JournalHandler() |
64 | 64 | #formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') |
@@ -112,8 +112,8 @@ def insertTxsFromBlock(block): |
112 | 112 | contract_value = '' |
113 | 113 | # Check if transaction is a contract transfer |
114 | 114 | if inputinfo.hex().startswith('0xa9059cbb'): |
115 | | - contract_to = inputinfo[10:-64] |
116 | | - contract_value = inputinfo[74:] |
| 115 | + contract_to = inputinfo.hex()[10:-64] |
| 116 | + contract_value = inputinfo.hex()[74:] |
117 | 117 | # Correct contract transfer transaction represents '0x' + 4 bytes 'a9059cbb' + 32 bytes (64 chars) for contract address and 32 bytes for its value |
118 | 118 | # Some buggy txs can break up Indexer, so we'll filter it |
119 | 119 | if len(contract_to) > 128: |
@@ -141,7 +141,7 @@ def insertTxsFromBlock(block): |
141 | 141 | maxblockindb = int(startBlock) |
142 | 142 |
|
143 | 143 | endblock = int(web3.eth.block_number) - int(confirmationBlocks) |
144 | | - |
| 144 | + |
145 | 145 | logger.info('Current best block in index: ' + str(maxblockindb) + '; in Ethereum chain: ' + str(endblock)) |
146 | 146 |
|
147 | 147 | for blockHeight in range(maxblockindb + 1, endblock): |
|
0 commit comments