Address A
holds 1 ether and address B
holds 0 ethers.
Lets create a transaction to transfer all balance from A
to B
.
This transaction will consume roughly gas_price * gas_used = 20 gwei * 21000 = 0.00042 ethers
at the time of writing.
In the end, the B
will hold 1 - 0.00042 = 0.99958 ethers
either way since there's only 1 ether in total existence.
When the sender creates the transaction, say with https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction, should he leave the estimated transaction cost 0.00042 ethers
in A
and reduce the transaction value to 0.99958
? Or is the fee reduced from the transaction's value automatically?
Put another way, if the sender sets the transaction's value to be 1 ether, will this transaction complete or not?