0

I want to distinguish between contract addresses and smart contract addresses. But when running

web3.eth.getCode()

in the geth console with either a contract or a non-contract address, it returns "0x".

I am using geth 1.8.22. Does anyone has an idea why that happens?

0

I met this problem sometime ago, in my case the node I connected to isn't fully synced, that is to say, the node is in the midst of a fast sync, you should know that

Fast sync finishes syncing Blocks/Transactions/Receipts well before 
the state sync finished and the contract code is part of the state sync.
  • It is possible to check whether node is synced or not via web3.eth.syncing. – Mikhail Vladimirov Apr 11 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.