{"record":{"id":"c8667d4ca8a936da","repo":"ethereum/go-ethereum","slug":"contract-transaction-couldn-t-be-found-after-50-bl","errorCode":null,"errorMessage":"Contract transaction couldn't be found after 50 blocks","messagePattern":"Contract transaction couldn't be found after 50 blocks","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"internal/jsre/deps/web3.js","lineNumber":2898,"sourceCode":"var checkForContractAddress = function(contract, callback){\n    var count = 0,\n        callbackFired = false;\n\n    // wait for receipt\n    var filter = contract._eth.filter('latest', function(e){\n        if (!e && !callbackFired) {\n            count++;\n\n            // stop watching after 50 blocks (timeout)\n            if (count > 50) {\n\n                filter.stopWatching(function() {});\n                callbackFired = true;\n\n                if (callback)\n                    callback(new Error('Contract transaction couldn\\'t be found after 50 blocks'));\n                else\n                    throw new Error('Contract transaction couldn\\'t be found after 50 blocks');\n\n\n            } else {\n\n                contract._eth.getTransactionReceipt(contract.transactionHash, function(e, receipt){\n                    if(receipt && !callbackFired) {\n\n                        contract._eth.getCode(receipt.contractAddress, function(e, code){\n                            /*jshint maxcomplexity: 6 */\n\n                            if(callbackFired || !code)\n                                return;\n\n                            filter.stopWatching(function() {});\n                            callbackFired = true;\n\n                            if(code.length > 3) {\n","sourceCodeStart":2880,"sourceCodeEnd":2916,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/internal/jsre/deps/web3.js#L2880-L2916","documentation":"After deploying a contract via web3's contract constructor, the code polls getTransactionReceipt once per new block via a filter. If the transaction receipt has not appeared within 50 blocks, it stops watching and reports (via callback or throw) that the contract transaction could not be found. This is a deployment-confirmation timeout, not a consensus error.","triggerScenarios":"new web3.eth.Contract(abi).new({...}, callback) where the sendTransaction succeeded but the tx was never mined within 50 blocks: gas price too low so miners ignore it, out of gas on a full block, node out of sync, or the transaction was dropped from the mempool.","commonSituations":"Deploying with a low gas price on a congested network, deploying while the local geth node is still syncing, or a stalled/overloaded dev node (dev mode not mining). Also happens if the account had insufficient balance and the tx never propagated.","solutions":["Check the deployment transaction hash (contract.transactionHash) with eth.getTransaction to see if it is pending or was dropped.","Resend with a higher gas price so miners include the deployment within 50 blocks.","Ensure the geth node is fully synced and (in dev mode) that mining/sealing is running.","Verify the sending account has enough balance for gas+value before deploying."],"exampleFix":"// before\ncontract.new({from: acct, data: code, gas: 3000000, gasPrice: web3.toWei(1, 'gwei')}, cb);\n\n// after\ncontract.new({from: acct, data: code, gas: 3000000, gasPrice: web3.toWei(20, 'gwei')}, cb);","handlingStrategy":"retry","validationCode":"function deployWithRetry(Contract, opts, cb, tries) {\n  tries = tries || 0;\n  Contract.new(opts, function (err, c) {\n    if (err && /couldn't be found after 50 blocks/.test(err.message) && tries < 3) {\n      opts.gasPrice = (opts.gasPrice || web3.toWei(1, 'gwei')) * 1.5;\n      return deployWithRetry(Contract, opts, cb, tries + 1);\n    }\n    cb(err, c);\n  });\n}","typeGuard":null,"tryCatchPattern":"contract.new(opts, function (err, c) {\n  if (err && err.message.indexOf(\"couldn't be found after 50 blocks\") !== -1) {\n    // inspect c.transactionHash via eth.getTransaction, then bump gasPrice and redeploy\n  }\n});","preventionTips":["Always pass a callback to contract.new so the timeout is an error, not a thrown exception.","Set a competitive gasPrice before deploying.","Confirm the node is synced and the sender has balance."],"tags":["web3","deployment","timeout","mining"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}