10

I've sent a simple transaction (no smart contract invocation) while my geth node had no peers attached. It created the transaction fine and returned a transaction identifier.

Even with many nodes connected now, I cannot find this transaction on any block explorer. I presume this means it wasn't broadcasted?

How can I rebroadcast the transaction?

eth
  • 85,679
  • 53
  • 285
  • 406
q9f
  • 32,913
  • 47
  • 156
  • 395

2 Answers2

12

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.

Then

eth.resend(tx, <optional gas price>, <optional gas limit>).

This allows you to change the gas price and gas limit of the resent transaction.

From the docs.

Tjaden Hess
  • 37,046
  • 10
  • 91
  • 118
  • 1
    Great explanation, but given the number of steps and the fact that code is involved I don't know if you can get away with "just" :) – Jeff Coleman Jan 26 '16 at 08:25
  • 2
    Note that pendingTransactions is an array, not a function, so you would retrieve the first pending transaction with var tx = eth.pendingTransactions[0], without parentheses. – carver May 03 '17 at 02:33
  • 1
    eth.resend(eth.pendingTransactions[0]) Error: Transaction 0885f7449756ae676259370a7c20dcf1c983f4276b7b333de505460928c1b164 not found – cobordism Jun 21 '17 at 11:42
2

For what is worth, slightly related.

I've sent a transaction from MetaMask with low gas price.

I was searching for a solution to fix it.

Luckily MetaMask offers a convenient solution:

enter image description here

(great feature, thank you developers)

Mars Robertson
  • 1,011
  • 1
  • 15
  • 35