|
@@ -445,30 +445,34 @@ begin
|
|
node := TNode.Node;
|
|
node := TNode.Node;
|
|
if Not Assigned(Node)
|
|
if Not Assigned(Node)
|
|
then exit;
|
|
then exit;
|
|
- accountBlockOps := GC.AddObject(TOperationsResumeList.Create ) as TOperationsResumeList;
|
|
|
|
- list := GC.AddObject( Classes.TList.Create ) as Classes.TList;
|
|
|
|
- for acc in FAccounts do begin
|
|
|
|
- // Load pending operations first
|
|
|
|
- list.Clear;
|
|
|
|
- accountBlockOps.Clear;
|
|
|
|
- Node.Operations.OperationsHashTree.GetOperationsAffectingAccount( acc, list );
|
|
|
|
- if list.Count > 0 then
|
|
|
|
- for i := list.Count - 1 downto 0 do begin
|
|
|
|
- Op := node.Operations.OperationsHashTree.GetOperation( PtrInt( list[i] ) );
|
|
|
|
- If TPCOperation.OperationToOperationResume( 0, Op, acc, OPR ) then begin
|
|
|
|
- OPR.NOpInsideBlock := i;
|
|
|
|
- OPR.Block := Node.Operations.OperationBlock.block; ;
|
|
|
|
- OPR.Balance := Node.Operations.SafeBoxTransaction.Account( acc {Op.SignerAccount} ).balance;
|
|
|
|
- AContainer.Add(OPR);
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
|
|
+ TUserInterface.Node.Bank.SafeBox.StartThreadSafe;
|
|
|
|
+ try
|
|
|
|
+ accountBlockOps := GC.AddObject(TOperationsResumeList.Create ) as TOperationsResumeList;
|
|
|
|
+ list := GC.AddObject( Classes.TList.Create ) as Classes.TList;
|
|
|
|
+ for acc in FAccounts do begin
|
|
|
|
+ // Load pending operations first
|
|
|
|
+ list.Clear;
|
|
|
|
+ accountBlockOps.Clear;
|
|
|
|
+ Node.Operations.OperationsHashTree.GetOperationsAffectingAccount( acc, list );
|
|
|
|
+ if list.Count > 0 then
|
|
|
|
+ for i := list.Count - 1 downto 0 do begin
|
|
|
|
+ Op := node.Operations.OperationsHashTree.GetOperation( PtrInt( list[i] ) );
|
|
|
|
+ If TPCOperation.OperationToOperationResume( 0, Op, acc, OPR ) then begin
|
|
|
|
+ OPR.NOpInsideBlock := i;
|
|
|
|
+ OPR.Block := Node.Operations.OperationBlock.block; ;
|
|
|
|
+ OPR.Balance := Node.Operations.SafeBoxTransaction.Account( acc {Op.SignerAccount} ).balance;
|
|
|
|
+ AContainer.Add(OPR);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
|
|
- // Load block ops
|
|
|
|
- Node.GetStoredOperationsFromAccount(accountBlockOps, acc, MaxInt, 0, MaxInt);
|
|
|
|
- for i := 0 to accountBlockOps.Count - 1 do
|
|
|
|
- AContainer.Add(accountBlockOps[i]);
|
|
|
|
|
|
+ // Load block ops
|
|
|
|
+ Node.GetStoredOperationsFromAccount(accountBlockOps, acc, MaxInt, 0, MaxInt);
|
|
|
|
+ for i := 0 to accountBlockOps.Count - 1 do
|
|
|
|
+ AContainer.Add(accountBlockOps[i]);
|
|
|
|
+ end;
|
|
|
|
+ finally
|
|
|
|
+ TUserInterface.Node.Bank.SafeBox.EndThreadSave;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TPendingOperationsDataSource }
|
|
{ TPendingOperationsDataSource }
|