Skip to content

Commit 801a64d

Browse files
committed
Start fixing some more p2p issues
1 parent da492ca commit 801a64d

File tree

9 files changed

+394
-34
lines changed

9 files changed

+394
-34
lines changed

dcc_client/dcc_client/Main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ int main()
405405
p2p.AddToPeerList(commandParts[1]);
406406
p2p.SavePeerList();
407407
}
408+
else if (commandParts[0] == "--PRINTP2PINFO") {
409+
p2p.PrintP2PInfo();
410+
}
408411
//else if (commandParts[0] == "--VERBOSITY")
409412
//{
410413
// WalletSettingValues::verbose = std::stoi(commandParts[1]);

dcc_client/dcc_client/P2PClient.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,15 @@ void P2P::SetPeer(std::string key)
786786
}
787787
}
788788

789+
void P2P::PrintP2PInfo()
790+
{
791+
console::WriteLine("P2P Information:");
792+
console::WriteLine("peerListID: " + peerListID);
793+
console::WriteLine("peerIP: " + peerIP);
794+
console::WriteLine("peerPort: " + std::to_string(peerPort));
795+
console::WriteLine("messageStatus: " + std::to_string(messageStatus));
796+
}
797+
789798
// The function that is run in a thread in order to reply or send data to a peer in the background
790799
void P2P::SenderThread()
791800
{

dcc_client/dcc_client/P2PClient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class P2P {
147147
void SetPeer(std::string id);
148148
//int mySendTo(int socket, std::string& s, int len, int redundantFlags, sockaddr* to, int toLen);
149149
int OpenP2PSocket(int port);
150+
void PrintP2PInfo();
150151
void SenderThread();
151152
int mySendTo(int socket, std::string& s, int len, int redundantFlags, sockaddr* to, int toLen);
152153
void InitPeerList();

dcc_client/dcc_client/Session.vim

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if &shortmess =~ 'A'
1313
else
1414
set shortmess=aoO
1515
endif
16-
badd +1173 P2PClient.cpp
16+
badd +794 P2PClient.cpp
1717
badd +22 SettingsConsts.h
1818
badd +471 Main.cpp
1919
badd +31 P2PClient.h
@@ -118,44 +118,46 @@ normal! zo
118118
normal! zo
119119
749
120120
normal! zo
121-
790
121+
773
122122
normal! zo
123-
801
123+
799
124124
normal! zo
125-
802
125+
810
126126
normal! zo
127-
831
127+
811
128128
normal! zo
129-
850
129+
840
130130
normal! zo
131-
906
131+
859
132132
normal! zo
133-
910
133+
915
134134
normal! zo
135-
945
135+
919
136136
normal! zo
137-
960
137+
954
138138
normal! zo
139-
1052
139+
969
140140
normal! zo
141-
1062
141+
1061
142142
normal! zo
143-
1065
143+
1071
144144
normal! zo
145-
1137
145+
1074
146146
normal! zo
147-
1171
147+
1146
148148
normal! zo
149-
1183
149+
1180
150150
normal! zo
151-
1191
151+
1192
152152
normal! zo
153-
let s:l = 1173 - ((27 * winheight(0) + 28) / 56)
153+
1200
154+
normal! zo
155+
let s:l = 794 - ((45 * winheight(0) + 28) / 56)
154156
if s:l < 1 | let s:l = 1 | endif
155157
keepjumps exe s:l
156158
normal! zt
157-
keepjumps 1173
158-
normal! 071|
159+
keepjumps 794
160+
normal! 048|
159161
tabnext
160162
edit P2PClient.h
161163
argglobal
@@ -420,12 +422,12 @@ normal! zo
420422
normal! zo
421423
707
422424
normal! zo
423-
let s:l = 471 - ((45 * winheight(0) + 28) / 56)
425+
let s:l = 344 - ((28 * winheight(0) + 28) / 56)
424426
if s:l < 1 | let s:l = 1 | endif
425427
keepjumps exe s:l
426428
normal! zt
427-
keepjumps 471
428-
normal! 0140|
429+
keepjumps 344
430+
normal! 021|
429431
tabnext
430432
argglobal
431433
if bufexists(fnamemodify("term://~/Code/Distributed-Compute-Coin/dcc_client/dcc_client//336272:/bin/bash", ":p")) | buffer term://~/Code/Distributed-Compute-Coin/dcc_client/dcc_client//336272:/bin/bash | else | edit term://~/Code/Distributed-Compute-Coin/dcc_client/dcc_client//336272:/bin/bash | endif
@@ -441,12 +443,12 @@ setlocal fdl=99
441443
setlocal fml=1
442444
setlocal fdn=20
443445
setlocal fen
444-
let s:l = 476 - ((55 * winheight(0) + 28) / 56)
446+
let s:l = 56 - ((55 * winheight(0) + 28) / 56)
445447
if s:l < 1 | let s:l = 1 | endif
446448
keepjumps exe s:l
447449
normal! zt
448-
keepjumps 476
449-
normal! 076|
450+
keepjumps 56
451+
normal! 0
450452
tabnext
451453
edit SettingsConsts.h
452454
argglobal
@@ -464,7 +466,7 @@ keepjumps exe s:l
464466
normal! zt
465467
keepjumps 23
466468
normal! 036|
467-
tabnext 9
469+
tabnext 1
468470
set stal=1
469471
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
470472
silent exe 'bwipe ' . s:wipebuf

0 commit comments

Comments
 (0)