MCPcopy Create free account
hub / github.com/DNAProject/DNA / AppendTxToPool

Function AppendTxToPool

http/base/actor/txnpool.go:49–67  ·  view source on GitHub ↗

append transaction to pool to txpool actor

(txn *types.Transaction)

Source from the content-addressed store, hash-verified

47
48//append transaction to pool to txpool actor
49func AppendTxToPool(txn *types.Transaction) (ontErrors.ErrCode, string) {
50 if DisableSyncVerifyTx {
51 txReq := &tcomn.TxReq{txn, tcomn.HttpSender, nil}
52 txnPid.Tell(txReq)
53 return ontErrors.ErrNoError, ""
54 }
55 //add Pre Execute Contract
56 _, err := PreExecuteContract(txn)
57 if err != nil {
58 return ontErrors.ErrUnknown, err.Error()
59 }
60 ch := make(chan *tcomn.TxResult, 1)
61 txReq := &tcomn.TxReq{txn, tcomn.HttpSender, ch}
62 txnPid.Tell(txReq)
63 if msg, ok := <-ch; ok {
64 return msg.Err, msg.Desc
65 }
66 return ontErrors.ErrUnknown, ""
67}
68
69//GetTxsFromPool from txpool actor
70func GetTxsFromPool(byCount bool) map[common.Uint256]*types.Transaction {

Callers

nothing calls this directly

Calls 2

PreExecuteContractFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected