Refactor message encoding into protocol package. User Agent must be now provided in the Init function.

This commit is contained in:
Kleissner
2021-10-18 04:37:02 +02:00
parent f1e8e0cab8
commit c9d9be2972
15 changed files with 149 additions and 142 deletions

View File

@@ -6,8 +6,15 @@ Author: Peter Kleissner
package core
var userAgent = "Peernet Core/0.1" // must be overwritten by the caller
// Init initializes the client. The config must be loaded first!
func Init() {
// The User Agent must be provided in the form "Application Name/1.0".
func Init(UserAgent string) {
if userAgent = UserAgent; userAgent == "" {
return
}
initFilters()
initPeerID()
initUserBlockchain()