github.com/avahowell/sia@v0.5.1-beta.0.20160524050156-83dcc3d37c94/api/transactionpool.go (about)

     1  package api
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/NebulousLabs/Sia/types"
     7  
     8  	"github.com/julienschmidt/httprouter"
     9  )
    10  
    11  type TransactionPoolGET struct {
    12  	Transactions []types.Transaction `json:"transactions"`
    13  }
    14  
    15  // transactionpoolTransactionsHandler handles the API call to get the
    16  // transaction pool trasactions.
    17  func (srv *Server) transactionpoolTransactionsHandler(w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
    18  	writeJSON(w, TransactionPoolGET{Transactions: srv.tpool.TransactionList()})
    19  }