Skip to content

Commit

Permalink
Convert package for easier consumption
Browse files Browse the repository at this point in the history
Modded the pkg format to be easier to consume
  • Loading branch information
name committed Apr 26, 2019
1 parent b23bb49 commit d5bf9a1
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
13 changes: 6 additions & 7 deletions cmd/phantom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ import (
"fmt"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"log"
"phantom/pkg/socket/wire"
"phantom/pkg/phantom"
"phantom/internal"
"github.com/breakcrypto/phantom/pkg/socket/wire"
"github.com/breakcrypto/phantom/pkg/phantom"
"strconv"
"sync"
"time"
Expand Down Expand Up @@ -168,7 +167,7 @@ func main() {
addrProcessingChannel := make(chan wire.NetAddress, 1500)
hashProcessingChannel := make(chan chainhash.Hash, 1500)

hashQueue := internal.NewQueue(12)
hashQueue := phantom.NewQueue(12)

if bootstrapExplorer != "" {
bootstrapper := phantom.Bootstrapper{bootstrapExplorer}
Expand Down Expand Up @@ -199,7 +198,7 @@ func main() {
hashQueue.Push(&bootstrapHash)
}

internal.Preamble(VERSION)
phantom.Preamble(VERSION)

time.Sleep(10 * time.Second)

Expand Down Expand Up @@ -256,7 +255,7 @@ func main() {
waitGroup.Wait()
}

func generatePings(pingChannel chan phantom.MasternodePing, queue *internal.Queue, magicMessage string) {
func generatePings(pingChannel chan phantom.MasternodePing, queue *phantom.Queue, magicMessage string) {
for {

fmt.Println("Loading settings.")
Expand All @@ -265,7 +264,7 @@ func generatePings(pingChannel chan phantom.MasternodePing, queue *internal.Queu
}
}

func processNewHashes(hashChannel chan chainhash.Hash, queue *internal.Queue) {
func processNewHashes(hashChannel chan chainhash.Hash, queue *phantom.Queue) {
for {
hash := <-hashChannel

Expand Down
Binary file added phantom-windows-amd64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion pkg/phantom/bootstraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"io/ioutil"
"log"
"net/http"
"phantom/pkg/socket/wire"
"github.com/breakcrypto/phantom/pkg/socket/wire"
"strconv"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/phantom/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"log"
"net"
"phantom/pkg/socket/wire"
"github.com/breakcrypto/phantom/pkg/socket/wire"
"strconv"
"strings"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion pkg/phantom/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"strings"
"time"
"phantom/pkg/socket/wire"
"github.com/breakcrypto/phantom/pkg/socket/wire"
)

func ConvertVersionStringToInt(str string) uint32 {
Expand Down
7 changes: 3 additions & 4 deletions pkg/phantom/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ import (
"github.com/btcsuite/btcutil"
"log"
"os"
"phantom/pkg/socket/wire"
"phantom/internal"
"github.com/breakcrypto/phantom/pkg/socket/wire"
"sort"
"strconv"
"strings"
Expand All @@ -56,7 +55,7 @@ type MasternodePing struct {
MagicMessage string
SentinelVersion uint32
DaemonVersion uint32
HashQueue *internal.Queue
HashQueue *Queue
}

type pingSlice []MasternodePing
Expand Down Expand Up @@ -90,7 +89,7 @@ func determinePingTime(unixTime string) (time.Time) {
return base.Add(result)
}

func GeneratePingsFromMasternodeFile(filePath string, pingChannel chan MasternodePing, queue *internal.Queue,
func GeneratePingsFromMasternodeFile(filePath string, pingChannel chan MasternodePing, queue *Queue,
magicMessage string, sentinelVersion uint32, daemonVersion uint32) {

currentTime := time.Now().UTC()
Expand Down
2 changes: 1 addition & 1 deletion internal/preamble.go → pkg/phantom/preamble.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* it in the license file.
*/

package internal
package phantom

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion internal/queue.go → pkg/phantom/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* it in the license file.
*/

package internal
package phantom

import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
Expand Down

0 comments on commit d5bf9a1

Please sign in to comment.