Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
protocol changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NosoDevTeam committed Sep 2, 2024
1 parent 80e7adb commit 5f619c7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 77 deletions.
2 changes: 1 addition & 1 deletion lastrelease.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.3Aa7 0.4.2Da2 x {LastOfficial} {LastBeta} {TestNet}
0.4.3Aa8 0.4.2Da2 x {LastOfficial} {LastBeta} {TestNet}
23 changes: 2 additions & 21 deletions masterpaskalform.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ object Form1: TForm1
Height = 488
Top = 38
Width = 640
ActivePage = TabConsole
ActivePage = TabWallet
Align = alTop
Anchors = [akTop, akLeft, akRight, akBottom]
Font.CharSet = ANSI_CHARSET
Expand All @@ -327,7 +327,7 @@ object Form1: TForm1
Font.Pitch = fpVariable
Font.Quality = fqDraft
ParentFont = False
TabIndex = 1
TabIndex = 0
TabOrder = 0
object TabWallet: TTabSheet
Caption = 'Wallet'
Expand Down Expand Up @@ -765,25 +765,6 @@ object Form1: TForm1
end
end
end
object TabSheet2: TTabSheet
Caption = 'Offers'
ClientHeight = 432
ClientWidth = 624
object OffersGrid: TStringGrid
Left = 0
Height = 432
Top = 0
Width = 624
Align = alClient
ColCount = 4
FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRowSelect, goSmoothScroll]
RowCount = 1
ScrollBars = ssVertical
TabOrder = 0
OnResize = OffersGridResize
end
end
end
end
object TabConsole: TTabSheet
Expand Down
17 changes: 1 addition & 16 deletions masterpaskalform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ TForm1 = class(TForm)
Edit2: TEdit;
Label19: TLabel;
Memobannedmethods: TMemo;
OffersGrid: TStringGrid;
Label1: TLabel;
Label14: TLabel;
Label15: TLabel;
Expand Down Expand Up @@ -348,7 +347,6 @@ TForm1 = class(TForm)
TabSheet1: TTabSheet;
TabNodesReported: TTabSheet;
TabNodesVerified: TTabSheet;
TabSheet2: TTabSheet;
TabThreads: TTabSheet;
TabFiles: TTabSheet;
StaTimeLab: TLabel;
Expand Down Expand Up @@ -470,7 +468,6 @@ TForm1 = class(TForm)
procedure MemobannedmethodsEditingDone(Sender: TObject);

procedure MemoRPCWhitelistEditingDone(sender: TObject);
procedure OffersGridResize(Sender: TObject);
procedure PC_ProcessesResize(Sender: TObject);
Procedure RestartTimerEjecutar(sender: TObject);
Procedure StartProgram();
Expand Down Expand Up @@ -576,7 +573,7 @@ TForm1 = class(TForm)
RestartFileName = 'launcher.sh';
updateextension = 'tgz';
{$ENDIF}
NodeRelease = 'Aa7';
NodeRelease = 'Aa8';
OficialRelease = true;
BetaRelease = false;
VersionRequired = '0.4.2';
Expand Down Expand Up @@ -2026,18 +2023,6 @@ procedure TForm1.GVTsGridResize(sender: TObject);
form1.GVTsGrid.ColWidths[1]:= thispercent(80,GridWidth,true);
End;

// Resize: Offers grid
procedure TForm1.OffersGridResize(Sender: TObject);
var
GridWidth : integer;
Begin
GridWidth := form1.OffersGrid.Width;
form1.OffersGrid.ColWidths[0]:= thispercent(15,GridWidth);
form1.OffersGrid.ColWidths[1]:= thispercent(15,GridWidth);
form1.OffersGrid.ColWidths[2]:= thispercent(15,GridWidth);
form1.OffersGrid.ColWidths[3]:= thispercent(55,GridWidth,true);
End;

{$ENDREGION}

{$REGION To Re-evaluate}
Expand Down
6 changes: 4 additions & 2 deletions mpblock.pas
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ implementation
NPDSource : string;
NPDTarget : string;
NPDAmount : int64;

BlockTrfrs : integer = 0;

Begin
if WO_skipBlocks then exit;
Expand Down Expand Up @@ -183,7 +183,7 @@ implementation
end;
end;
if ExistsInLastBlock then continue;
if ArrayPoolTXs[contador].TimeStamp+60 > TimeStamp then
if ( (ArrayPoolTXs[contador].TimeStamp+60 > TimeStamp) or (BlockTrfrs>=2000) ) then
begin
if ArrayPoolTXs[contador].TimeStamp < TimeStamp+600 then
insert(ArrayPoolTXs[contador],IgnoredTrxs,length(IgnoredTrxs));
Expand All @@ -198,6 +198,7 @@ implementation
ArrayPoolTXs[contador].Block:=numero;
ArrayPoolTXs[contador].sender:=OperationAddress;
insert(ArrayPoolTXs[contador],ListaOrdenes,length(listaordenes));
Inc(BlockTrfrs);
end;
end;
if ArrayPoolTXs[contador].OrderType='TRFR' then
Expand All @@ -210,6 +211,7 @@ implementation
ArrayPoolTXs[contador].Block:=numero;
ArrayPoolTXs[contador].sender:=OperationAddress;
insert(ArrayPoolTXs[contador],ListaOrdenes,length(listaordenes));
Inc(BlockTrfrs);
end;
end;
if ( (ArrayPoolTXs[contador].OrderType='SNDGVT') and ( ArrayPoolTXs[contador].sender = AdminPubKey) ) then
Expand Down
20 changes: 0 additions & 20 deletions mpgui.pas
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ procedure TFormSlots.GridMSlotsPrepareCanvas(sender: TObject; aCol, aRow: Intege
form1.GVTsGrid.Cells[1,0] := 'Address';
form1.GVTsGrid.FocusRectVisible:=false;

form1.OffersGrid.Cells[0,0] := 'Mode';
form1.OffersGrid.Cells[1,0] := 'Expire';
form1.OffersGrid.Cells[2,0] := 'Fee';
form1.OffersGrid.Cells[3,0] := 'Owner';
form1.OffersGrid.FocusRectVisible:=false;
End;

// Ordena las salidas de informacion
Expand Down Expand Up @@ -291,7 +286,6 @@ procedure TFormSlots.GridMSlotsPrepareCanvas(sender: TObject; aCol, aRow: Intege
LastUpdateProcesses : int64 = 0;
LastUpdateConsensus : int64 = 0;
LastUpdateDataPanel : int64 = 0;
LastUpdatePSO : int64 = 0;
var
contador : integer = 0;
LocalProcesses : TProcessCopy;
Expand Down Expand Up @@ -342,20 +336,6 @@ procedure TFormSlots.GridMSlotsPrepareCanvas(sender: TObject; aCol, aRow: Intege
end;
end;

if LastUpdatePSO <> UTCTime then
begin
LPSOs := GetPSOsCopy;
Form1.OffersGrid.RowCount:=Length(LPSOs)+1;
for contador := 0 to length(LPSOs)-1 do
begin
Form1.OffersGrid.Cells[0,contador+1]:=LPSOs[contador].Mode.ToString;
Form1.OffersGrid.Cells[1,contador+1]:=LPSOs[contador].Expire.ToString;
Form1.OffersGrid.Cells[2,contador+1]:=GetPSOValue(PSOFee,LPSOs[contador].Params);
Form1.OffersGrid.Cells[3,contador+1]:=LPSOs[contador].owner;
end;
LAstUpdatePSO := UTCTime;
end;

if LastUpdateProcesses<> UTCTime then
begin
if form1.PC_Processes.ActivePage = Form1.TabThreads then
Expand Down
7 changes: 7 additions & 0 deletions mpparser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ function SendFunds(LineText:string;showOutput:boolean=true):string;
ResultOrderID : String = '';
CoinsAvailable : int64;
DestinationRecord : TSummaryData;
SendersString : string = '';
Begin
result := '';
BeginPerformance('SendFunds');
Expand Down Expand Up @@ -772,6 +773,12 @@ function SendFunds(LineText:string;showOutput:boolean=true):string;
while monto > 0 do
begin
BeginPerformance('SendFundsVerify');
if AnsiContainsstr(SendersString,GetWallArrIndex(contador).Hash) then
begin
ToLog('console','Duplicated address on order');
Exit;
end;
SendersString := SendersString+GetWallArrIndex(contador).Hash;
if GetAddressBalanceIndexed(GetWallArrIndex(contador).Hash)-GetAddressPendingPays(GetWallArrIndex(contador).Hash) > 0 then
begin
trxLinea := TrxLinea+1;
Expand Down
31 changes: 14 additions & 17 deletions mpprotocol.pas
Original file line number Diff line number Diff line change
Expand Up @@ -858,14 +858,20 @@ function ValidateTrfr(order:Torderdata;Origen:String):integer;
Result := '';
TRY
NumTransfers := StrToInt(Parameter(TextLine,5));
ToLog('Console',format('Order with %d transfers',[Numtransfers]));
ToLog('Console',format('Complete line: %s',[TextLine]));
ToLog('events',format('Order with %d transfers',[Numtransfers]));
ToLog('events',format('Complete line: %s',[TextLine]));
RecOrderId := Parameter(TextLine,7);
GenOrderID := Parameter(TextLine,5)+Parameter(TextLine,10);
Textbak := GetOpData(TextLine);
SetLength(TrxArray,0);SetLength(senderTrx,0);
if NumTransfers > 30 then
begin
Proceder := false;
ErrorCode := 89;
end;
for cont := 0 to NumTransfers-1 do
begin
if not Proceder then Break;
SetLength(TrxArray,length(TrxArray)+1);SetLength(senderTrx,length(senderTrx)+1);
if not GetOrderFromString(Textbak,TrxArray[cont]) then
begin
Expand All @@ -887,33 +893,25 @@ function ValidateTrfr(order:Torderdata;Origen:String):integer;
ErrorCode := 97;
//ToLog('console',format('error: %s <> %s',[senderTrx[cont],TrxArray[cont].Address ]))
end;
if pos(sendersString,senderTrx[cont]) > 0 then
if AnsiContainsstr(sendersString,senderTrx[cont]) then
begin
Proceder:=false; // hay una direccion de envio repetida
Proceder:=false; // sender duplicated
ErrorCode := 99;
end;
sendersString := sendersString + senderTrx[cont];
Textbak := copy(textBak,2,length(textbak));
Textbak := GetOpData(Textbak);
if not Proceder then Break;
end;
GenOrderID := GetOrderHash(GenOrderID);
if TotalFee >= GetMinimumFee(TotalSent) then
if TotalFee < GetMinimumFee(TotalSent) then
begin
//ToLog('console',Format('Order fees match : %d >= %d',[TotalFee,GetFee(TotalSent)]))
end
else
begin
//ToLog('console',Format('WRONG ORDER FEES : %d >= %d',[TotalFee,GetFee(TotalSent)]));
TodoValido := false;
ErrorCode := 100;
end;
if RecOrderId<>GenOrderID then
begin
//ToLog('console','<-'+RecOrderId);
//ToLog('console','->'+GenOrderID);
if mylastblock >= 56000 then TodoValido := false;
if mylastblock >= 56000 then ErrorCode := 101;
TodoValido := false;
ErrorCode := 101;
end;
if TodoValido then
begin
Expand All @@ -940,8 +938,7 @@ function ValidateTrfr(order:Torderdata;Origen:String):integer;
end
else
begin
if ErrorCode>0 then
if mylastblock >= 56000 then Result := 'ERROR '+ErrorCode.ToString;
if ErrorCode>0 then Result := 'ERROR '+ErrorCode.ToString;
end;
EXCEPT ON E:EXCEPTION DO
begin
Expand Down

0 comments on commit 5f619c7

Please sign in to comment.