You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
655 B

  1. package core
  2. import (
  3. "fmt"
  4. ctypes "github.com/tendermint/tendermint/rpc/core/types"
  5. "github.com/tendermint/tendermint/types"
  6. )
  7. //-----------------------------------------------------------------------------
  8. // Note: tx must be signed
  9. func BroadcastTx(tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
  10. err := mempoolReactor.BroadcastTx(tx)
  11. if err != nil {
  12. return nil, fmt.Errorf("Error broadcasting transaction: %v", err)
  13. }
  14. return &ctypes.ResultBroadcastTx{}, nil
  15. }
  16. func ListUnconfirmedTxs() (*ctypes.ResultListUnconfirmedTxs, error) {
  17. txs, err := mempoolReactor.Mempool.Reap()
  18. return &ctypes.ResultListUnconfirmedTxs{len(txs), txs}, err
  19. }