core, ethclient: implement Metropolis EIP 98 (#14750)
Implements ethereum/EIPs#98
This commit is contained in:
		
				
					committed by
					
						 Felix Lange
						Felix Lange
					
				
			
			
				
	
			
			
			
						parent
						
							47359301a2
						
					
				
				
					commit
					a56f3dc0d9
				
			| @@ -104,11 +104,17 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, author *common | ||||
| 	} | ||||
|  | ||||
| 	// Update the state with pending changes | ||||
| 	var root []byte | ||||
| 	if config.IsMetropolis(header.Number) { | ||||
| 		statedb.Finalise() | ||||
| 	} else { | ||||
| 		root = statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes() | ||||
| 	} | ||||
| 	usedGas.Add(usedGas, gas) | ||||
|  | ||||
| 	// Create a new receipt for the transaction, storing the intermediate root and gas used by the tx | ||||
| 	// based on the eip phase, we're passing wether the root touch-delete accounts. | ||||
| 	root := statedb.IntermediateRoot(config.IsEIP158(header.Number)) | ||||
| 	receipt := types.NewReceipt(root.Bytes(), usedGas) | ||||
| 	receipt := types.NewReceipt(root, usedGas) | ||||
| 	receipt.TxHash = tx.Hash() | ||||
| 	receipt.GasUsed = new(big.Int).Set(gas) | ||||
| 	// if the transaction created a contract, store the creation address in the receipt. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user