|
@@ -506,19 +506,11 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
- If Not FSignatureChecked then begin
|
|
|
- If Not TCrypto.ECDSAVerify(account_signer.accountInfo.accountkey,GetOperationHashToSign(FData),FData.sign) then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- FHasValidSignature := false;
|
|
|
- exit;
|
|
|
- end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
- end else begin
|
|
|
- If Not FHasValidSignature then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- exit;
|
|
|
- end;
|
|
|
- end;
|
|
|
+ If Not TCrypto.ECDSAVerify(account_signer.accountInfo.accountkey,GetOperationHashToSign(FData),FData.sign) then begin
|
|
|
+ errors := 'Invalid sign';
|
|
|
+ FHasValidSignature := false;
|
|
|
+ exit;
|
|
|
+ end else FHasValidSignature := true;
|
|
|
FPrevious_Signer_updated_block := account_signer.updated_block;
|
|
|
FPrevious_Destination_updated_block := account_target.updated_block;
|
|
|
If (public_key in FData.changes_type) then begin
|
|
@@ -607,7 +599,6 @@ begin
|
|
|
end else begin
|
|
|
FHasValidSignature := true;
|
|
|
end;
|
|
|
- FSignatureChecked:=True;
|
|
|
end;
|
|
|
|
|
|
function TOpChangeAccountInfo.toString: String;
|
|
@@ -658,7 +649,6 @@ begin
|
|
|
end else begin
|
|
|
FHasValidSignature := true;
|
|
|
end;
|
|
|
- FSignatureChecked:=True;
|
|
|
end;
|
|
|
|
|
|
function TOpTransaction.DoOperation(AccountPreviousUpdatedBlock : TAccountPreviousBlockInfo; AccountTransaction : TPCSafeBoxTransaction; var errors : AnsiString) : Boolean;
|
|
@@ -736,20 +726,12 @@ begin
|
|
|
end;
|
|
|
|
|
|
// Check signature
|
|
|
- If Not FSignatureChecked then begin
|
|
|
- _h := GetTransactionHashToSign(FData);
|
|
|
- if (Not TCrypto.ECDSAVerify(sender.accountInfo.accountkey,_h,FData.sign)) then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- FHasValidSignature := false;
|
|
|
- Exit;
|
|
|
- end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
- end else begin
|
|
|
- If Not FHasValidSignature then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- exit;
|
|
|
- end;
|
|
|
- end;
|
|
|
+ _h := GetTransactionHashToSign(FData);
|
|
|
+ if (Not TCrypto.ECDSAVerify(sender.accountInfo.accountkey,_h,FData.sign)) then begin
|
|
|
+ errors := 'Invalid sign';
|
|
|
+ FHasValidSignature := false;
|
|
|
+ Exit;
|
|
|
+ end else FHasValidSignature := true;
|
|
|
//
|
|
|
FPrevious_Signer_updated_block := sender.updated_block;
|
|
|
FPrevious_Destination_updated_block := target.updated_block;
|
|
@@ -1084,7 +1066,6 @@ begin
|
|
|
TLog.NewLog(lterror,Classname,'Error signing a new Change key');
|
|
|
FHasValidSignature := false;
|
|
|
end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
end;
|
|
|
|
|
|
function TOpChangeKey.DoOperation(AccountPreviousUpdatedBlock : TAccountPreviousBlockInfo; AccountTransaction : TPCSafeBoxTransaction; var errors : AnsiString) : Boolean;
|
|
@@ -1168,19 +1149,11 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
- If Not FSignatureChecked then begin
|
|
|
- If Not TCrypto.ECDSAVerify(account_signer.accountInfo.accountkey,GetOperationHashToSign(FData),FData.sign) then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- FHasValidSignature := false;
|
|
|
- exit;
|
|
|
- end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
- end else begin
|
|
|
- If Not FHasValidSignature then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- exit;
|
|
|
- end;
|
|
|
- end;
|
|
|
+ If Not TCrypto.ECDSAVerify(account_signer.accountInfo.accountkey,GetOperationHashToSign(FData),FData.sign) then begin
|
|
|
+ errors := 'Invalid sign';
|
|
|
+ FHasValidSignature := false;
|
|
|
+ exit;
|
|
|
+ end else FHasValidSignature := true;
|
|
|
|
|
|
FPrevious_Signer_updated_block := account_signer.updated_block;
|
|
|
FPrevious_Destination_updated_block := account_target.updated_block;
|
|
@@ -1393,7 +1366,6 @@ begin
|
|
|
FData.n_operation := n_operation;
|
|
|
FData.fee := fee;
|
|
|
FHasValidSignature := true; // Recover founds doesn't need a signature
|
|
|
- FSignatureChecked := True;
|
|
|
end;
|
|
|
|
|
|
function TOpRecoverFounds.DoOperation(AccountPreviousUpdatedBlock : TAccountPreviousBlockInfo; AccountTransaction : TPCSafeBoxTransaction; var errors : AnsiString) : Boolean;
|
|
@@ -1623,19 +1595,11 @@ begin
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
- If Not FSignatureChecked then begin
|
|
|
- If Not TCrypto.ECDSAVerify(account_signer.accountInfo.accountkey,GetOperationHashToSign(FData),FData.sign) then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- FHasValidSignature := false;
|
|
|
- exit;
|
|
|
- end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
- end else begin
|
|
|
- If Not FHasValidSignature then begin
|
|
|
- errors := 'Invalid sign';
|
|
|
- exit;
|
|
|
- end;
|
|
|
- end;
|
|
|
+ If Not TCrypto.ECDSAVerify(account_signer.accountInfo.accountkey,GetOperationHashToSign(FData),FData.sign) then begin
|
|
|
+ errors := 'Invalid sign';
|
|
|
+ FHasValidSignature := false;
|
|
|
+ exit;
|
|
|
+ end else FHasValidSignature := true;
|
|
|
|
|
|
FPrevious_Signer_updated_block := account_signer.updated_block;
|
|
|
FPrevious_Destination_updated_block := account_target.updated_block;
|
|
@@ -1872,7 +1836,6 @@ begin
|
|
|
TLog.NewLog(lterror,Classname,'Error signing a new list account for sale operation');
|
|
|
FHasValidSignature := false;
|
|
|
end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
end;
|
|
|
|
|
|
function TOpListAccountForSale.IsDelist: Boolean;
|
|
@@ -1900,7 +1863,6 @@ begin
|
|
|
TLog.NewLog(lterror,Classname,'Error signing a delist account operation');
|
|
|
FHasValidSignature := false;
|
|
|
end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
end;
|
|
|
|
|
|
function TOpDelistAccountForSale.IsDelist: Boolean;
|
|
@@ -1936,7 +1898,6 @@ begin
|
|
|
TLog.NewLog(lterror,Classname,'Error signing a new Buy operation');
|
|
|
FHasValidSignature := false;
|
|
|
end else FHasValidSignature := true;
|
|
|
- FSignatureChecked:=True;
|
|
|
end;
|
|
|
|
|
|
procedure TOpBuyAccount.InitializeData;
|