as I know, the transaction should be confirmed by 11 times then it will be done. but when i use eth_getbalance to get the balance ,it will return some fake balance without confirmed. so How can I get the real balance with json rpc ? thanks for replying!
1 Answer
Requiring X amount of confirmations is just a convention and it varies.
A confirmation in this case refers to a block on top of the block in question. So if the transaction is inside block 7 and you want to have 11 confirmations for the transactions then you just wait until block 18 and see if the transaction is still valid.
The larger the number X, the more likely it is that the transaction will not be removed due to the blockchain reaching a different consensus. In theory it is possible for the blockchain to still revert a transaction after years of it being made but the chances for that are, for all practical reasons, zero. 11 is a pretty secure amount of confirmations (blocks) - different exchanges require different amount of confirmations before the transaction is considered secure enough.
eth_getbalance
will return the actual balance in the blockchain! Otherwise it won't return anything.