0

In my scenario, I would like to keep a restriction on the min value on a transaction.

For example, if A is to transfer some ETH to B, the min amount he can is > 0.01 ETH. So that a miner cannot include transactions < 0.01 ETH.

How can I achieve this? Any idea would help.

0

You cannot influence the miner in any way through the structure of your smart contract. What you can do, however, is limit the user's ability to send greater than or less than a certain amount of funds, which it looks like you are trying to do.

In this case, you would include the following line in the function being called:

require(msg.value > 0.01 ether);

This will cause the transaction to fail if someone sends less than that amount in.

  • The case I was talking about was 1-1 micro payments. I need to get this with miner level. Suppose if somehow we limit the Tx value to 0.1 ETH, and the miner includes a lesser value, is there no way to reject it in geth source code? The motive behind this is to prevent spamming of micro value Tx. – rohan sethi Dec 3 '18 at 6:15

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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