that option already exists
Are you referring to passing nonce manually? If so probably we can make life even easier by adding an option like override
in options.
that option already exists
Are you referring to passing nonce manually? If so probably we can make life even easier by adding an option like override
in options.
Yes, manual nonce for now.
An override options should work like âuse this nonce if it is valid, otherwise create newâ.
And then, to not have to use getNonce
explicitly, letâs make subscribe
return {txHash, nonce}
.
I actually meant something even simpler:
transferTo(address, amount, {override: true})
subscribe(topic, duration, identifier, meta, {override: true})
...
Then it will only use ledger nonce but not txpool nonce.
I had thought of some problem with that, but forgot it by now.
Itâll work if you make it override the tx with the same identifier, rather than the latest one, so you donât end up overriding the wrong tx.
Itâll work if you make it override the tx with the same identifier, rather than the latest one, so you donât end up overriding the wrong tx.
Itâs probably not going to work (easily) because: 1) you donât know the details of a submitted txn unless record it locally; 2) even if you do, txpool is a node-local thing and might be different for different node, so there is no global correct answer.
So the easiest way to do it is just changing whether to consider nonce in txpool.
Yes, well, âoverride latest txâ isnât that useful, since youâll end up overriding the wrong tx on the regular.