append transaction to pool to txpool actor
(txn *types.Transaction)
| 47 | |
| 48 | //append transaction to pool to txpool actor |
| 49 | func 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 |
| 70 | func GetTxsFromPool(byCount bool) map[common.Uint256]*types.Transaction { |
nothing calls this directly
no test coverage detected