以太坊交易凭证里面的 cumulativeGasUsed 是什么意思?
发布于 4 个月前 作者 mysql2017 710 次浏览 来自 以太坊
> eth.getTransactionReceipt('0x3462c9de713daf554a9da604906dff2f61c74c38ad81225571a552bb269c6faf')
{
  blockHash: "0x68e9164dea279b9923ea485399c36ec69f62d85991efd6849770d5df80ffd80f",
  blockNumber: 3,
  contractAddress: null,
  cumulativeGasUsed: 21000,
  from: "0xc702cf859782e73bc75dafbed93c216552c1277a",
  gasUsed: 21000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  root: "0xa33114eea95453c64e8e4a8c974281fe36848723102bf2d059b80300568dc1fa",
  to: "0xd27b9d73f58b6f26d7f708e1c8deec5909a3069f",
  transactionHash: "0x3462c9de713daf554a9da604906dff2f61c74c38ad81225571a552bb269c6faf",
  transactionIndex: 0
}

这笔交易是0xc702cf859782e73bc75dafbed93c216552c1277a账号发起的第2笔交易了 请问,cumulativeGasUsed 这个字段代表的是什么意思?

4 回复

cumulativeGasUsed 的值 为啥和 gasUsed一样的

累计使用的gas和gas used一样的

@xianfeng92 什么情况下,cumulativeGasUsed 的值和 gasUsed 不一样?

cumulativeGasUsed: Number - The total amount of gas used when this transaction was executed in the block. 这个就是记录你一共使用多少gas 本人也是以太坊技术爱好者,欢迎来github中一起学习和交流 https://github.com/xianfeng92/Love-Ethereum

回到顶部