func PlaceAndFill(client1 *benchclient.BenchClient, client2 *benchclient.BenchClient, pair string, howMany int) {
	for i := 0; i < howMany; i++ {
		// This shouldnt make any change in balance but each account should have at least 2000 satoshis (or the smallest unit in whatever chain)
		bufErrChan := make(chan error, 4)
		orderChan := make(chan *cxrpc.SubmitOrderReply)
		go client1.OrderAsync(client1.PrivKey.PubKey(), "buy", pair, 1000, 1.0, orderChan, bufErrChan)
		go client2.OrderAsync(client2.PrivKey.PubKey(), "sell", pair, 1000, 1.0, orderChan, bufErrChan)
		go client1.OrderAsync(client1.PrivKey.PubKey(), "sell", pair, 2000, 2.0, orderChan, bufErrChan)
		go client2.OrderAsync(client2.PrivKey.PubKey(), "buy", pair, 1000, 2.0, orderChan, bufErrChan)

		for i := 0; i < cap(bufErrChan); i++ {
			select {
			case err := <-bufErrChan:
				if err != nil {
					logging.Errorf("Error placing and filling")
				}
			case order := <-orderChan:
				if order != nil {
					logging.Infof("Placed order %s", order.OrderID)
				}
			}
			if err := <-bufErrChan; err != nil {
				logging.Errorf("Error placing and filling: %s", err)
			}
		}
	}
	return
}
// PlaceAndFill places a whole bunch of orders (in goroutines of course) and fills a whole bunch of orders.
PlaceAndFill places a whole bunch of orders (in goroutines of course) and fills a whole bunch of orders.
// PlaceAndFill places a whole bunch of orders ( in goroutines of course ) and fills a whole bunch of orders .
func PlaceAndFill(client1 *benchclient.BenchClient, client2 *benchclient.BenchClient, pair string, howMany int) {
	for i := 0; i < howMany; i++ {
		bufErrChan := make(chan error, 4)
		orderChan := make(chan *cxrpc.SubmitOrderReply)
		go client1.OrderAsync(client1.PrivKey.PubKey(), "buy", pair, 1000, 1.0, orderChan, bufErrChan)
		go client2.OrderAsync(client2.PrivKey.PubKey(), "sell", pair, 1000, 1.0, orderChan, bufErrChan)
		go client1.OrderAsync(client1.PrivKey.PubKey(), "sell", pair, 2000, 2.0, orderChan, bufErrChan)
		go client2.OrderAsync(client2.PrivKey.PubKey(), "buy", pair, 1000, 2.0, orderChan, bufErrChan)
		for i := 0; i < cap(bufErrChan); i++ {
			select {
			case err := <-bufErrChan:
				if err != nil {
					logging.Errorf("Error placing and filling")
				}
			case order := <-orderChan:
				if order != nil {
					logging.Infof("Placed order %s", order.OrderID)
				}
			}
			if err := <-bufErrChan; err != nil {
				logging.Errorf("Error placing and filling: %s", err)
			}
		}
	}
	return
}
func PlaceAndFill ( client1 * benchclient . BenchClient , client2 * benchclient . BenchClient , pair string , howMany int ) { for i := 0 ; i < howMany ; i ++ { bufErrChan := make ( chan error , 4 ) orderChan := make ( chan * cxrpc . SubmitOrderReply ) go client1 . OrderAsync ( client1 . PrivKey . PubKey ( ) , " " , pair , 1000 , 1.0 , orderChan , bufErrChan ) go client2 . OrderAsync ( client2 . PrivKey . PubKey ( ) , " " , pair , 1000 , 1.0 , orderChan , bufErrChan ) go client1 . OrderAsync ( client1 . PrivKey . PubKey ( ) , " " , pair , 2000 , 2.0 , orderChan , bufErrChan ) go client2 . OrderAsync ( client2 . PrivKey . PubKey ( ) , " " , pair , 1000 , 2.0 , orderChan , bufErrChan ) for i := 0 ; i < cap ( bufErrChan ) ; i ++ { select { case err := <- bufErrChan : if err != nil { logging . Errorf ( " " ) } case order := <- orderChan : if order != nil { logging . Infof ( " " , order . OrderID ) } } if err := <- bufErrChan ; err != nil { logging . Errorf ( " " , err ) } } } return }
PlaceAndFill places a whole bunch of orders (in goroutines of course) and fills a whole bunch of orders.
PlaceAndFill places a whole bunch of orders ( in goroutines of course ) and fills a whole bunch of orders .
// This shouldnt make any change in balance but each account should have at least 2000 satoshis (or the smallest unit in whatever chain)