diff --git a/builds/node/node_darwin-amd64 b/builds/node/node_darwin-amd64 index 5b1276b..5cf1a58 100755 Binary files a/builds/node/node_darwin-amd64 and b/builds/node/node_darwin-amd64 differ diff --git a/builds/node/node_darwin-arm64 b/builds/node/node_darwin-arm64 index dce1b70..939f735 100755 Binary files a/builds/node/node_darwin-arm64 and b/builds/node/node_darwin-arm64 differ diff --git a/builds/node/node_linux-386 b/builds/node/node_linux-386 index 4f31240..a54be8c 100755 Binary files a/builds/node/node_linux-386 and b/builds/node/node_linux-386 differ diff --git a/builds/node/node_linux-amd64 b/builds/node/node_linux-amd64 index d2a5966..a16634a 100755 Binary files a/builds/node/node_linux-amd64 and b/builds/node/node_linux-amd64 differ diff --git a/builds/node/node_linux-arm b/builds/node/node_linux-arm index 2492462..893260a 100755 Binary files a/builds/node/node_linux-arm and b/builds/node/node_linux-arm differ diff --git a/builds/node/node_linux-arm64 b/builds/node/node_linux-arm64 index 3f9c6da..b9e4624 100755 Binary files a/builds/node/node_linux-arm64 and b/builds/node/node_linux-arm64 differ diff --git a/builds/node/node_windows-386 b/builds/node/node_windows-386 index 2c6e575..4405dcd 100755 Binary files a/builds/node/node_windows-386 and b/builds/node/node_windows-386 differ diff --git a/builds/node/node_windows-amd64 b/builds/node/node_windows-amd64 index 628bc70..97304ed 100755 Binary files a/builds/node/node_windows-amd64 and b/builds/node/node_windows-amd64 differ diff --git a/builds/node/node_windows-arm b/builds/node/node_windows-arm index 7ccc10c..b280383 100755 Binary files a/builds/node/node_windows-arm and b/builds/node/node_windows-arm differ diff --git a/builds/node/node_windows-arm64 b/builds/node/node_windows-arm64 index b8e5a07..6477a19 100755 Binary files a/builds/node/node_windows-arm64 and b/builds/node/node_windows-arm64 differ diff --git a/cmdline.go b/cmdline.go index b001d9b..85e64cd 100644 --- a/cmdline.go +++ b/cmdline.go @@ -31,6 +31,12 @@ func RunCmd(input string) { fmt.Printf("Blockchain successfully synced!") fmt.Printf("Length: %d", len(blockchain)) } else if action == "balance" { + if len(fields) == 1 { + publicKey := GetKey().PublicKey.Y + balance := GetBalance(*publicKey) + fmt.Println(fmt.Sprintf("Balance of %s: %f", publicKey.String(), balance)) + return + } keyStr := fields[1] var key big.Int key.SetString(keyStr, 10) @@ -102,17 +108,6 @@ func RunCmd(input string) { if err != nil { panic(err) } - } else if action == "exit" { - os.Exit(0) - } else if action == "help" { - fmt.Println("Commands:") - fmt.Println("sync - Sync the blockchain with peers") - fmt.Println("balance - Get the balance of a public key") - fmt.Println("send - Send an amount to a public key") - fmt.Println("keygen - Generate a new key") - fmt.Println("savestate - Save the blockchain to a file") - fmt.Println("loadstate - Load the blockchain from a file") - fmt.Println("exit - Exit the console") } else if action == "addpeer" { if *useLocalPeerList { // Add the peer to the local peer list @@ -135,6 +130,17 @@ func RunCmd(input string) { } else if action == "bootstrap" { Bootstrap() fmt.Println("Bootstrap complete!") + } else if action == "exit" { + os.Exit(0) + } else if action == "help" { + fmt.Println("Commands:") + fmt.Println("sync - Sync the blockchain with peers") + fmt.Println("balance - Get the balance of a public key") + fmt.Println("send - Send an amount to a public key") + fmt.Println("keygen - Generate a new key") + fmt.Println("savestate - Save the blockchain to a file") + fmt.Println("loadstate - Load the blockchain from a file") + fmt.Println("exit - Exit the console") } else if action == "license" { license, err := os.ReadFile("COPYING") if err != nil {