36
votes
Accepted
How to make miner to mine only when there are Pending Transactions?
You can load this script to your geth console
Mine only when there are transactions!
var mining_threads = 1
function checkWork() {
if (eth.getBlock("pending").transactions.length > 0)...
23
votes
Accepted
eth.pendingTransactions vs eth.getBlock('pending').transactions
eth.pendingTransactions are the transactions that your local Geth node has, that haven't been mined to a block.
eth.getBlock('pending') is the current block your node is mining (or would be mining on)...
eth♦
- 78.3k
11
votes
Accepted
How to resend a transaction not recognized by the network?
Just use eth.pendingTransactions to find the transaction you want to resend.
Then
var tx = eth.pendingTransactions[index], replacing index with the index of the transaction you want to resend.
...
10
votes
Accepted
Filters: what's "latest" and "pending"?
Latest means the latest block that is already inside your own chain. All transactions contained within can be considered successfully executed. Security wise of course there can be reorgs, but in ...
10
votes
Accepted
How to get pending transactions with using geth or other client?
To get the pending transactions you need a node that you're running on your own because this type of action requires a lot of resources.
You can run your own Geth node and wait until it is ...
9
votes
Transaction stuck because of low gas price
Looking at your transaction, you have set a gas price of 4 gwei.
Though not very high for current traffic, this should eventually get picked up.
You can check gas prices and traffic on ETH Gas watch. ...
8
votes
Accepted
Are pending transactions "dropped" and "reinstated"?
My understanding is that your understanding is correct, except you're missing one particular property of the Ethereum node software. Namely, as part of #3, the transaction is stored in the node's ...
8
votes
In Parity, what is the equivalent RPC call to geth's txpool_content?
The closest I was able to find is parity_pendingTransactions and parity_pendingTransactionsStats.
parity_pendingTransactions is very similar to geth's txpool_content, and gets the job done.
Update: ...
8
votes
Accepted
weird transaction sending to self
It's about canceling a transaction. More precisely, it's a replacement transaction for something else that was in the pending transaction pool.
Consider a case where a transaction is sent with ...
6
votes
Accepted
geth transactions stuck in pending, resend fails
I still don't know why eth.resend was failing (and continues to fail as of geth 1.6.5), but this compatible patch works for me:
eth.resend = function (tx, gasPrice, gas) {
if (gasPrice) {
tx....
6
votes
Transaction pending in queue for 100mins +
The network's under strain cause of the Status ICO. Unfortunately there's not much you can do for cancelling it since the transaction has already been propagated to other nodes.
If you click on the ...
6
votes
Accepted
Monitoring Pending Transactions
You can create a stream of pending transactions using web3.eth.subscribe('pendingTransactions' [, callback]);, which currently returns a transaction hash.
You can turn into the actual transaction ...
5
votes
Accepted
Waiting for a transaction to be confirmed
Example here using filters: How do I know when I've run out of gas programmatically?
and also here by busy polling: https://github.com/barkthins/ether-pudding/blob/master/index.js#L375
I use ...
5
votes
Waiting for a transaction to be confirmed
We can subscribe to events from the send method. For example we need to wait for 5 confirmations before considering a transaction mined we can do the following:
return new Promise((resolve, reject) =&...
5
votes
Accepted
Transaction having low gasPrice makes all the other transactions hang on the pending state
Péter Szilágyi's answer on (https://github.com/ethereum/go-ethereum/issues/16284) help me to solve the problem.
Every account and transaction in Ethereum has a nonce. At any given
time, only the ...
5
votes
Accepted
is it possible to run pending transactions on local node to see the outcome?
You can totally simulated the transaction througth eth_call.
Her are the code snippets of eth_call and apply transaction (source from go-ethereum):
eth_call (could not change state)
// Setup the ...
5
votes
Accepted
Why is Etherscan's "Pending transactions" count so huge?
60k - 80k pending transactions sounds like a normal situation and does not seem extensive.
Currently, Ethereum does ~750k transactions daily. Assuming all transactions are processed at the same rate, ...
4
votes
Accepted
What are those multiple transactions in the transaction pool?
These transactions are from a mining pool. You can see the frequently mined blocks in 0xea674fdde714fd979de3edf0f56aa9716b898ec8.
What you saw in txpool.content.pending are just two pending ...
4
votes
Optimal way of waiting for transactions to be mined in geth
Xavier has a good solution with clear usage examples here: https://gist.github.com/xavierlepretre/88682e871f4ad07be4534ae560692ee6. You get a thenable transaction receipt. This is a non-blocking ...
4
votes
After the gas price, is the transaction hash used to prioritize pending transactions?
In Parity the hash is the an item for the ordering criteria, as you can see here: https://github.com/paritytech/parity/blob/1aaafa2d11b42af6be97754f4bc06e2856904464/ethcore/src/miner/transaction_queue....
4
votes
Can I spend funds from a pending transaction?
I have an educated guess based on the following scenario that Ethereum does permit:
A sends 10 eth to B. (Tx01)
While Tx01 is pending, A also sends 10 eth to C. (Tx02)
Whether Tx01 or Tx02 end up in ...
4
votes
Accepted
Get pending transactions to a given address/contract
Have a look here Understanding transactions better
Full nodes listen and broadcast transactions. As a full node you receive and can display the pending transactions in your transaction pool. That's ...
4
votes
Accepted
For sending a transaction to Ethereum, we need to be a "full node"?
To send a transaction to the network, all you need is a connection to it.
When using geth or parity, your the nodes may not broadcast your transactions until they are reasonably close to being fully ...
4
votes
Accepted
How to modify the algorithm of transaction selection in Ethereum private net?
Sure, you can implement your own algorithm to order the txpool. Currently, they order by gas price that make sense for mining incentive
https://github.com/ethereum/go-ethereum/blob/...
4
votes
Accepted
How to get ethereum gasPrice from a transaction hash?
Instead of using getTransactionReceipt, I used getTransaction
So, to solve the above, we can use:
var accountOneGasPrice = (await web3.eth.getTransaction(accountOneReceipt.tx)).gasPrice
Where ...
4
votes
Accepted
Contract ERC20 creation "pending"
I assume you deployed it on the Main Net using MetaMask.
Probably the gas limit of the transaction was too low.
Otherwise the gas price was to low.
Please send a screenshot of your MetaMask ...
4
votes
How to hide transactions from mempool?
It's just a slow node...
When a node receives a transaction, it sends it to other connected nodes, who then send it to other connected nodes (repeat), until all the nodes have the transaction in their ...
4
votes
Proxy contract to avoid sniping bot
That is not going to make a difference, bots are looking for pending transactions that execute the addLiquidity method. In order for that to work, the addLiquidity method on the router contract needs ...
3
votes
Accepted
Is it normal pending transaction are removed after restart of geth?
Yes, that's normal Geth behavior.
eth.pendingTransactions are the transactions that your local Geth node has, that haven't been mined to a block. Geth does not persist these anywhere, so they are ...
eth♦
- 78.3k
3
votes
Lost ether: wallet on some other chain
Your coins seem to be in your account on the public blockchain explorer, so I don't think you have to worry.
The next step is to work out what has happened in your local wallet. Presumably you are ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pending-transactions × 302transactions × 128
go-ethereum × 58
txpool × 43
web3js × 33
mining × 21
nonce × 20
openethereum × 20
gas × 18
metamask × 17
etherscan × 17
gas-price × 16
ether × 15
web3.py × 12
private-blockchain × 9
blockchain × 8
solidity × 7
contract-deployment × 7
contract-invocation × 7
ethers.js × 7
contract-development × 6
blocks × 6
raw-transaction × 6
transaction-propagation × 6
wallets × 5