Git Product home page Git Product logo

Comments (5)

thereksfour avatar thereksfour commented on August 16, 2024

并且当我连续向区块发送该消息时,正常交易将无法被处理

while True:
    sendTrans = "{\"method\": \"Chain33.SendToAddress\",\"params\": [{\"From\": \"1CbEVT9RnM5oZhWMj4fxUrJX94VtRotzvs\",\"To\": \"1GhMZ7vpEEGLUmxcf8KRNedjpKZYFus9dJ\",\"amount\": 100000000}],\"id\": 0}"
    print sendTrans
    req2 = requests.post("http://localhost:8801",data=sendTrans)
    print 'sendTrans',req2.text

image
image

from chain33.

thereksfour avatar thereksfour commented on August 16, 2024

在调试中我发现,问题似乎是在执行区块时,当交易出错后,仅仅将 block 中的交易删除,但是没有删除掉 mempool 中的交易。并且由于该交易无法扣除 Fee,执行级别为 ExecErr,我在 mempool 的 api 中似乎只发现了删除 ExecPack 级别交易的 api。

在 blockchain/exec.go 文件的 execBlock 函数中,似乎是这样,请问有别的发现吗?

		if receipt.Ty == types.ExecErr {
			chainlog.Error("exec tx err", "err", receipt)
			if errReturn { //认为这个是一个错误的区块
				return nil, nil, types.ErrBlockExec
			}
			deltxlist[i] = true
			continue
		}
...
	//删除无效的交易
	var deltx []*types.Transaction
	if len(deltxlist) > 0 {
		var newtx []*types.Transaction
		for i := 0; i < len(block.Txs); i++ {
			if deltxlist[i] {
				deltx = append(deltx, block.Txs[i])
			} else {
				newtx = append(newtx, block.Txs[i])
			}
		}
		block.Txs = newtx
		block.TxHash = merkle.CalcMerkleRoot(block.Txs)
	}

from chain33.

vipwzw avatar vipwzw commented on August 16, 2024

应该是这个问题,我们正在思考怎么修复。

from chain33.

33cn avatar 33cn commented on August 16, 2024

应该有三个问题:

  1. mempool 没有不应该让这样的交易进入打包环节

  2. 公司模块执行删除的交易,对应的mempool 中也要删除。

  3. solo 挖矿 在交易删除光了之后,应该重新挖,而不是创建出区块。

from chain33.

33cn avatar 33cn commented on August 16, 2024

@icehawk-hyb 你来修复这三个问题

from chain33.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.