|
@@ -517,7 +517,7 @@ Type
|
|
procedure AssignTo(Dest: TPersistent); Override;
|
|
procedure AssignTo(Dest: TPersistent); Override;
|
|
function GetActualTargetSecondsAverage(BackBlocks : Cardinal): Real;
|
|
function GetActualTargetSecondsAverage(BackBlocks : Cardinal): Real;
|
|
function GetTargetSecondsAverage(FromBlock,BackBlocks : Cardinal): Real;
|
|
function GetTargetSecondsAverage(FromBlock,BackBlocks : Cardinal): Real;
|
|
- function LoadBankFromStream(Stream : TStream; useSecureLoad : Boolean; checkSafeboxHash : TRawBytes; progressNotify : TProgressNotify; var errors : AnsiString) : Boolean;
|
|
|
|
|
|
+ function LoadBankFromStream(Stream : TStream; useSecureLoad : Boolean; checkSafeboxHash : TRawBytes; previousCheckedSafebox : TPCSafebox; progressNotify : TProgressNotify; var errors : AnsiString) : Boolean;
|
|
Procedure Clear;
|
|
Procedure Clear;
|
|
Function LoadOperations(Operations : TPCOperationsComp; Block : Cardinal) : Boolean;
|
|
Function LoadOperations(Operations : TPCOperationsComp; Block : Cardinal) : Boolean;
|
|
Property SafeBox : TPCSafeBox read FSafeBox;
|
|
Property SafeBox : TPCSafeBox read FSafeBox;
|
|
@@ -1051,7 +1051,7 @@ begin
|
|
end else Result := true;
|
|
end else Result := true;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TPCBank.LoadBankFromStream(Stream: TStream; useSecureLoad : Boolean; checkSafeboxHash : TRawBytes; progressNotify : TProgressNotify; var errors: AnsiString): Boolean;
|
|
|
|
|
|
+function TPCBank.LoadBankFromStream(Stream: TStream; useSecureLoad : Boolean; checkSafeboxHash : TRawBytes; previousCheckedSafebox : TPCSafebox; progressNotify : TProgressNotify; var errors: AnsiString): Boolean;
|
|
Var LastReadBlock : TBlockAccount;
|
|
Var LastReadBlock : TBlockAccount;
|
|
i : Integer;
|
|
i : Integer;
|
|
auxSB : TPCSafeBox;
|
|
auxSB : TPCSafeBox;
|
|
@@ -1061,7 +1061,7 @@ begin
|
|
If useSecureLoad then begin
|
|
If useSecureLoad then begin
|
|
// When on secure load will load Stream in a separate SafeBox, changing only real SafeBox if successfully
|
|
// When on secure load will load Stream in a separate SafeBox, changing only real SafeBox if successfully
|
|
auxSB := TPCSafeBox.Create;
|
|
auxSB := TPCSafeBox.Create;
|
|
- Result := auxSB.LoadSafeBoxFromStream(Stream,true,checkSafeboxHash,progressNotify,LastReadBlock,errors);
|
|
|
|
|
|
+ Result := auxSB.LoadSafeBoxFromStream(Stream,true,checkSafeboxHash,progressNotify,previousCheckedSafebox,LastReadBlock,errors);
|
|
If Not Result then Exit;
|
|
If Not Result then Exit;
|
|
end;
|
|
end;
|
|
TPCThread.ProtectEnterCriticalSection(Self,FBankLock);
|
|
TPCThread.ProtectEnterCriticalSection(Self,FBankLock);
|
|
@@ -1069,7 +1069,7 @@ begin
|
|
If Assigned(auxSB) then begin
|
|
If Assigned(auxSB) then begin
|
|
SafeBox.CopyFrom(auxSB);
|
|
SafeBox.CopyFrom(auxSB);
|
|
end else begin
|
|
end else begin
|
|
- Result := SafeBox.LoadSafeBoxFromStream(Stream,False,checkSafeboxHash,progressNotify,LastReadBlock,errors);
|
|
|
|
|
|
+ Result := SafeBox.LoadSafeBoxFromStream(Stream,False,checkSafeboxHash,progressNotify,previousCheckedSafebox,LastReadBlock,errors);
|
|
end;
|
|
end;
|
|
If Not Result then exit;
|
|
If Not Result then exit;
|
|
If SafeBox.BlocksCount>0 then FLastOperationBlock := SafeBox.Block(SafeBox.BlocksCount-1).blockchainInfo
|
|
If SafeBox.BlocksCount>0 then FLastOperationBlock := SafeBox.Block(SafeBox.BlocksCount-1).blockchainInfo
|