Browse Source

Build 1.5.5

Build 1.5.5
PascalCoin 8 years ago
parent
commit
73e06e9447

BIN
PascalCoinWallet.res


+ 7 - 0
README.md

@@ -34,6 +34,13 @@ Also, consider a donation at PascalCoin development account: "0-10"
 
 
 ## History:  
 ## History:  
 
 
+### Build 1.5.5.0 - 2017-04-11
+- Corrected fee result on RPC calls as a negative number on "Change key" operations
+- Corrected PASCURRENCY value to be limited as a 4 decimal digits on RPC calls
+- JSON-RPC method "getaccountoperations" changed: if param "start" is -1, will include pending operations, otherwise not
+- Fixed bug: On "getaccountoperations" if an account had a lot of operations (receive tx included) then sometimes app crashed when executing depth search.
+  - Note: High depth search is slow because it search always starting from current state, going backwards, in order to return past balance. This can be a slow method on some account with high transactions volume.
+
 ### Build 1.5.4.0 - 2017-03-14
 ### Build 1.5.4.0 - 2017-03-14
 
 
 - Added Network Timestamp Adjustment (NAT) to calc valid timestamps
 - Added Network Timestamp Adjustment (NAT) to calc valid timestamps

+ 7 - 0
README.txt

@@ -34,6 +34,13 @@ Also, consider a donation at PascalCoin development account: "0-10"
 
 
 ## History:  
 ## History:  
 
 
+### Build 1.5.5.0 - 2017-04-11
+- Corrected fee result on RPC calls as a negative number on "Change key" operations
+- Corrected PASCURRENCY value to be limited as a 4 decimal digits on RPC calls
+- JSON-RPC method "getaccountoperations" changed: if param "start" is -1, will include pending operations, otherwise not
+- Fixed bug: On "getaccountoperations" if an account had a lot of operations (receive tx included) then sometimes app crashed when executing depth search.
+  - Note: High depth search is slow because it search always starting from current state, going backwards, in order to return past balance. This can be a slow method on some account with high transactions volume.
+
 ### Build 1.5.4.0 - 2017-03-14
 ### Build 1.5.4.0 - 2017-03-14
 
 
 - Added Network Timestamp Adjustment (NAT) to calc valid timestamps
 - Added Network Timestamp Adjustment (NAT) to calc valid timestamps

+ 21 - 1
Units/Forms/UFRMWallet.dfm

@@ -595,6 +595,10 @@ object FRMWallet: TFRMWallet
         object tsMultiSelectAccounts: TTabSheet
         object tsMultiSelectAccounts: TTabSheet
           Caption = 'Selected accounts for massive operations'
           Caption = 'Selected accounts for massive operations'
           ImageIndex = 1
           ImageIndex = 1
+          ExplicitLeft = 0
+          ExplicitTop = 0
+          ExplicitWidth = 0
+          ExplicitHeight = 0
           object dgSelectedAccounts: TDrawGrid
           object dgSelectedAccounts: TDrawGrid
             Left = 41
             Left = 41
             Top = 31
             Top = 31
@@ -784,6 +788,10 @@ object FRMWallet: TFRMWallet
     object tsPendingOperations: TTabSheet
     object tsPendingOperations: TTabSheet
       Caption = 'Pending Operations'
       Caption = 'Pending Operations'
       ImageIndex = 5
       ImageIndex = 5
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object dgPendingOperations: TDrawGrid
       object dgPendingOperations: TDrawGrid
         Left = 0
         Left = 0
         Top = 86
         Top = 86
@@ -831,6 +839,10 @@ object FRMWallet: TFRMWallet
     object tsBlockChain: TTabSheet
     object tsBlockChain: TTabSheet
       Caption = 'BlockChain Explorer'
       Caption = 'BlockChain Explorer'
       ImageIndex = 1
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel2: TPanel
       object Panel2: TPanel
         Left = 0
         Left = 0
         Top = 0
         Top = 0
@@ -876,6 +888,10 @@ object FRMWallet: TFRMWallet
     object tsOperations: TTabSheet
     object tsOperations: TTabSheet
       Caption = 'Operations Explorer'
       Caption = 'Operations Explorer'
       ImageIndex = 1
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel1: TPanel
       object Panel1: TPanel
         Left = 0
         Left = 0
         Top = 0
         Top = 0
@@ -921,6 +937,10 @@ object FRMWallet: TFRMWallet
     object tsLogs: TTabSheet
     object tsLogs: TTabSheet
       Caption = 'Logs'
       Caption = 'Logs'
       ImageIndex = 2
       ImageIndex = 2
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object pnlTopLogs: TPanel
       object pnlTopLogs: TPanel
         Left = 0
         Left = 0
         Top = 0
         Top = 0
@@ -1249,7 +1269,7 @@ object FRMWallet: TFRMWallet
     Left = 105
     Left = 105
     Top = 180
     Top = 180
     Bitmap = {
     Bitmap = {
-      494C010102000800E80110003000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+      494C010102000800EC0110003000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
       0000000000003600000028000000400000003000000001002000000000000030
       0000000000003600000028000000400000003000000001002000000000000030
       0000000000000000000000000000000000000000000000000000000000000000
       0000000000000000000000000000000000000000000000000000000000000000
       0000000000000000002A292929D60B0B0BF4111111EE0000006B000000000000
       0000000000000000002A292929D60B0B0BF4111111EE0000006B000000000000

+ 107 - 104
Units/Forms/UFRMWallet.lfm

@@ -4,7 +4,7 @@ object FRMWallet: TFRMWallet
   Top = 201
   Top = 201
   Width = 865
   Width = 865
   Caption = 'Pascal Coin Wallet, JSON-RPC Miner & Explorer'
   Caption = 'Pascal Coin Wallet, JSON-RPC Miner & Explorer'
-  ClientHeight = 600
+  ClientHeight = 580
   ClientWidth = 865
   ClientWidth = 865
   Color = clBtnFace
   Color = clBtnFace
   Constraints.MinHeight = 600
   Constraints.MinHeight = 600
@@ -162,7 +162,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Left = 90
       Height = 13
       Height = 13
       Top = 11
       Top = 11
-      Width = 70
+      Width = 60
       Caption = 'Total Blocks:'
       Caption = 'Total Blocks:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -170,7 +170,7 @@ object FRMWallet: TFRMWallet
       Left = 166
       Left = 166
       Height = 13
       Height = 13
       Top = 11
       Top = 11
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -178,7 +178,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Left = 90
       Height = 13
       Height = 13
       Top = 26
       Top = 26
-      Width = 106
+      Width = 89
       Caption = 'Current Block age:'
       Caption = 'Current Block age:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -186,7 +186,7 @@ object FRMWallet: TFRMWallet
       Left = 198
       Left = 198
       Height = 13
       Height = 13
       Top = 26
       Top = 26
-      Width = 96
+      Width = 81
       Caption = '000 seconds ago'
       Caption = '000 seconds ago'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -194,7 +194,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Left = 90
       Height = 13
       Height = 13
       Top = 41
       Top = 41
-      Width = 115
+      Width = 98
       Caption = 'Pending Operations:'
       Caption = 'Pending Operations:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -202,7 +202,7 @@ object FRMWallet: TFRMWallet
       Left = 207
       Left = 207
       Height = 13
       Height = 13
       Top = 41
       Top = 41
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -210,7 +210,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Left = 90
       Height = 13
       Height = 13
       Top = 56
       Top = 56
-      Width = 81
+      Width = 68
       Caption = 'Miners clients:'
       Caption = 'Miners clients:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -218,7 +218,7 @@ object FRMWallet: TFRMWallet
       Left = 177
       Left = 177
       Height = 13
       Height = 13
       Top = 56
       Top = 56
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -226,7 +226,7 @@ object FRMWallet: TFRMWallet
       Left = 429
       Left = 429
       Height = 13
       Height = 13
       Top = 11
       Top = 11
-      Width = 86
+      Width = 76
       Caption = 'Current Target:'
       Caption = 'Current Target:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -234,7 +234,7 @@ object FRMWallet: TFRMWallet
       Left = 518
       Left = 518
       Height = 13
       Height = 13
       Top = 11
       Top = 11
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -242,7 +242,7 @@ object FRMWallet: TFRMWallet
       Left = 370
       Left = 370
       Height = 13
       Height = 13
       Top = 26
       Top = 26
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -250,7 +250,7 @@ object FRMWallet: TFRMWallet
       Left = 285
       Left = 285
       Height = 13
       Height = 13
       Top = 26
       Top = 26
-      Width = 83
+      Width = 69
       Caption = 'Time average:'
       Caption = 'Time average:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -258,7 +258,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Left = 90
       Height = 13
       Height = 13
       Top = 70
       Top = 70
-      Width = 72
+      Width = 63
       Caption = 'Node Status:'
       Caption = 'Node Status:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -266,7 +266,7 @@ object FRMWallet: TFRMWallet
       Left = 168
       Left = 168
       Height = 13
       Height = 13
       Top = 70
       Top = 70
-      Width = 18
+      Width = 15
       Caption = '???'
       Caption = '???'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -274,7 +274,7 @@ object FRMWallet: TFRMWallet
       Left = 285
       Left = 285
       Height = 13
       Height = 13
       Top = 11
       Top = 11
-      Width = 55
+      Width = 48
       Caption = 'Accounts:'
       Caption = 'Accounts:'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -282,7 +282,7 @@ object FRMWallet: TFRMWallet
       Left = 344
       Left = 344
       Height = 13
       Height = 13
       Top = 11
       Top = 11
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       ParentColor = False
       ParentColor = False
     end
     end
@@ -290,7 +290,7 @@ object FRMWallet: TFRMWallet
       Left = 370
       Left = 370
       Height = 13
       Height = 13
       Top = 41
       Top = 41
-      Width = 21
+      Width = 18
       Caption = '000'
       Caption = '000'
       Font.Color = clGray
       Font.Color = clGray
       Font.Height = -11
       Font.Height = -11
@@ -302,7 +302,7 @@ object FRMWallet: TFRMWallet
       Left = 360
       Left = 360
       Height = 13
       Height = 13
       Top = 56
       Top = 56
-      Width = 86
+      Width = 74
       Caption = 'Blocks found:'
       Caption = 'Blocks found:'
       Font.Color = clWindowText
       Font.Color = clWindowText
       Font.Height = -11
       Font.Height = -11
@@ -316,7 +316,7 @@ object FRMWallet: TFRMWallet
       Height = 13
       Height = 13
       Hint = 'Blocks found while Miner is running...'
       Hint = 'Blocks found while Miner is running...'
       Top = 56
       Top = 56
-      Width = 24
+      Width = 21
       Caption = '000'
       Caption = '000'
       Font.Color = clWindowText
       Font.Color = clWindowText
       Font.Height = -11
       Font.Height = -11
@@ -330,9 +330,9 @@ object FRMWallet: TFRMWallet
     object lblReceivedMessages: TLabel
     object lblReceivedMessages: TLabel
       Cursor = crHandPoint
       Cursor = crHandPoint
       Left = 360
       Left = 360
-      Height = 22
+      Height = 23
       Top = 66
       Top = 66
-      Width = 211
+      Width = 185
       Caption = 'Received messages'
       Caption = 'Received messages'
       Font.Color = clRed
       Font.Color = clRed
       Font.Height = -19
       Font.Height = -19
@@ -344,9 +344,9 @@ object FRMWallet: TFRMWallet
     end
     end
     object lblBuild: TLabel
     object lblBuild: TLabel
       Left = 586
       Left = 586
-      Height = 22
+      Height = 23
       Top = 3
       Top = 3
-      Width = 56
+      Width = 49
       Caption = 'Build'
       Caption = 'Build'
       Font.Color = clWindowText
       Font.Color = clWindowText
       Font.Height = -19
       Font.Height = -19
@@ -358,8 +358,8 @@ object FRMWallet: TFRMWallet
   end
   end
   object StatusBar: TStatusBar
   object StatusBar: TStatusBar
     Left = 0
     Left = 0
-    Height = 21
-    Top = 579
+    Height = 23
+    Top = 557
     Width = 865
     Width = 865
     Panels = <    
     Panels = <    
       item
       item
@@ -379,7 +379,7 @@ object FRMWallet: TFRMWallet
   end
   end
   object PageControl: TPageControl
   object PageControl: TPageControl
     Left = 0
     Left = 0
-    Height = 488
+    Height = 466
     Top = 91
     Top = 91
     Width = 865
     Width = 865
     ActivePage = tsMyAccounts
     ActivePage = tsMyAccounts
@@ -389,11 +389,11 @@ object FRMWallet: TFRMWallet
     OnChange = PageControlChange
     OnChange = PageControlChange
     object tsMyAccounts: TTabSheet
     object tsMyAccounts: TTabSheet
       Caption = 'Accounts Explorer'
       Caption = 'Accounts Explorer'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       object Splitter1: TSplitter
       object Splitter1: TSplitter
         Left = 380
         Left = 380
-        Height = 395
+        Height = 374
         Top = 66
         Top = 66
         Width = 5
         Width = 5
       end
       end
@@ -401,41 +401,42 @@ object FRMWallet: TFRMWallet
         Left = 0
         Left = 0
         Height = 66
         Height = 66
         Top = 0
         Top = 0
-        Width = 861
+        Width = 857
         Align = alTop
         Align = alTop
+        BevelOuter = bvNone
         ClientHeight = 66
         ClientHeight = 66
-        ClientWidth = 861
+        ClientWidth = 857
         TabOrder = 0
         TabOrder = 0
         object Label18: TLabel
         object Label18: TLabel
           Left = 11
           Left = 11
           Height = 13
           Height = 13
           Top = 35
           Top = 35
-          Width = 70
+          Width = 61
           Caption = 'Find account'
           Caption = 'Find account'
           ParentColor = False
           ParentColor = False
         end
         end
         object cbMyPrivateKeys: TComboBox
         object cbMyPrivateKeys: TComboBox
           Left = 260
           Left = 260
-          Height = 31
+          Height = 21
           Top = 7
           Top = 7
           Width = 411
           Width = 411
-          ItemHeight = 0
+          ItemHeight = 13
           OnChange = cbMyPrivateKeysChange
           OnChange = cbMyPrivateKeysChange
           Style = csDropDownList
           Style = csDropDownList
           TabOrder = 0
           TabOrder = 0
         end
         end
         object cbExploreMyAccounts: TCheckBox
         object cbExploreMyAccounts: TCheckBox
           Left = 11
           Left = 11
-          Height = 24
+          Height = 19
           Top = 10
           Top = 10
-          Width = 329
+          Width = 235
           Caption = 'Explore accounts with one of my Wallet Keys'
           Caption = 'Explore accounts with one of my Wallet Keys'
           OnClick = cbExploreMyAccountsClick
           OnClick = cbExploreMyAccountsClick
           TabOrder = 1
           TabOrder = 1
         end
         end
         object ebFindAccountNumber: TEdit
         object ebFindAccountNumber: TEdit
           Left = 87
           Left = 87
-          Height = 23
+          Height = 21
           Top = 33
           Top = 33
           Width = 83
           Width = 83
           OnChange = ebFindAccountNumberChange
           OnChange = ebFindAccountNumberChange
@@ -453,16 +454,16 @@ object FRMWallet: TFRMWallet
         end
         end
         object cbFilterAccounts: TCheckBox
         object cbFilterAccounts: TCheckBox
           Left = 260
           Left = 260
-          Height = 24
+          Height = 19
           Top = 35
           Top = 35
-          Width = 202
+          Width = 145
           Caption = 'Filter accounts by balance'
           Caption = 'Filter accounts by balance'
           OnClick = cbFilterAccountsClick
           OnClick = cbFilterAccountsClick
           TabOrder = 4
           TabOrder = 4
         end
         end
         object ebFilterAccountByBalanceMin: TEdit
         object ebFilterAccountByBalanceMin: TEdit
           Left = 412
           Left = 412
-          Height = 23
+          Height = 21
           Hint = 'Min balance'
           Hint = 'Min balance'
           Top = 33
           Top = 33
           Width = 83
           Width = 83
@@ -472,7 +473,7 @@ object FRMWallet: TFRMWallet
         end
         end
         object ebFilterAccountByBalanceMax: TEdit
         object ebFilterAccountByBalanceMax: TEdit
           Left = 503
           Left = 503
-          Height = 23
+          Height = 21
           Hint = 'Max balance'
           Hint = 'Max balance'
           Top = 33
           Top = 33
           Width = 83
           Width = 83
@@ -483,17 +484,17 @@ object FRMWallet: TFRMWallet
       end
       end
       object pnlAccounts: TPanel
       object pnlAccounts: TPanel
         Left = 0
         Left = 0
-        Height = 395
+        Height = 374
         Top = 66
         Top = 66
         Width = 380
         Width = 380
         Align = alLeft
         Align = alLeft
         BevelOuter = bvNone
         BevelOuter = bvNone
-        ClientHeight = 395
+        ClientHeight = 374
         ClientWidth = 380
         ClientWidth = 380
         TabOrder = 1
         TabOrder = 1
         object dgAccounts: TDrawGrid
         object dgAccounts: TDrawGrid
           Left = 0
           Left = 0
-          Height = 361
+          Height = 340
           Top = 0
           Top = 0
           Width = 380
           Width = 380
           Align = alClient
           Align = alClient
@@ -507,7 +508,7 @@ object FRMWallet: TFRMWallet
         object pnlAccountsInfo: TPanel
         object pnlAccountsInfo: TPanel
           Left = 0
           Left = 0
           Height = 34
           Height = 34
-          Top = 361
+          Top = 340
           Width = 380
           Width = 380
           Align = alBottom
           Align = alBottom
           BevelOuter = bvNone
           BevelOuter = bvNone
@@ -518,7 +519,7 @@ object FRMWallet: TFRMWallet
             Left = 5
             Left = 5
             Height = 13
             Height = 13
             Top = 10
             Top = 10
-            Width = 55
+            Width = 48
             Caption = 'Accounts:'
             Caption = 'Accounts:'
             ParentColor = False
             ParentColor = False
           end
           end
@@ -526,7 +527,7 @@ object FRMWallet: TFRMWallet
             Left = 136
             Left = 136
             Height = 13
             Height = 13
             Top = 10
             Top = 10
-            Width = 49
+            Width = 41
             Caption = 'Balance:'
             Caption = 'Balance:'
             ParentColor = False
             ParentColor = False
           end
           end
@@ -534,7 +535,7 @@ object FRMWallet: TFRMWallet
             Left = 60
             Left = 60
             Height = 13
             Height = 13
             Top = 10
             Top = 10
-            Width = 21
+            Width = 18
             Caption = '000'
             Caption = '000'
             ParentColor = False
             ParentColor = False
           end
           end
@@ -542,7 +543,7 @@ object FRMWallet: TFRMWallet
             Left = 200
             Left = 200
             Height = 13
             Height = 13
             Top = 10
             Top = 10
-            Width = 21
+            Width = 18
             Caption = '000'
             Caption = '000'
             ParentColor = False
             ParentColor = False
           end
           end
@@ -588,22 +589,22 @@ object FRMWallet: TFRMWallet
       end
       end
       object pcAccountsOptions: TPageControl
       object pcAccountsOptions: TPageControl
         Left = 385
         Left = 385
-        Height = 395
+        Height = 374
         Top = 66
         Top = 66
-        Width = 476
+        Width = 472
         ActivePage = tsAccountOperations
         ActivePage = tsAccountOperations
         Align = alClient
         Align = alClient
         TabIndex = 0
         TabIndex = 0
         TabOrder = 2
         TabOrder = 2
         object tsAccountOperations: TTabSheet
         object tsAccountOperations: TTabSheet
           Caption = 'Operations of selected Account'
           Caption = 'Operations of selected Account'
-          ClientHeight = 368
-          ClientWidth = 472
+          ClientHeight = 348
+          ClientWidth = 464
           object dgAccountOperations: TDrawGrid
           object dgAccountOperations: TDrawGrid
             Left = 0
             Left = 0
-            Height = 368
+            Height = 348
             Top = 0
             Top = 0
-            Width = 472
+            Width = 464
             Align = alClient
             Align = alClient
             ExtendedSelect = False
             ExtendedSelect = False
             TabOrder = 0
             TabOrder = 0
@@ -813,14 +814,14 @@ object FRMWallet: TFRMWallet
     end
     end
     object tsPendingOperations: TTabSheet
     object tsPendingOperations: TTabSheet
       Caption = 'Pending Operations'
       Caption = 'Pending Operations'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       ImageIndex = 5
       ImageIndex = 5
       object dgPendingOperations: TDrawGrid
       object dgPendingOperations: TDrawGrid
         Left = 0
         Left = 0
-        Height = 375
+        Height = 354
         Top = 86
         Top = 86
-        Width = 861
+        Width = 857
         Align = alClient
         Align = alClient
         ExtendedSelect = False
         ExtendedSelect = False
         TabOrder = 0
         TabOrder = 0
@@ -833,18 +834,18 @@ object FRMWallet: TFRMWallet
         Left = 0
         Left = 0
         Height = 86
         Height = 86
         Top = 0
         Top = 0
-        Width = 861
+        Width = 857
         Align = alTop
         Align = alTop
         BevelOuter = bvNone
         BevelOuter = bvNone
         BorderWidth = 10
         BorderWidth = 10
         ClientHeight = 86
         ClientHeight = 86
-        ClientWidth = 861
+        ClientWidth = 857
         TabOrder = 1
         TabOrder = 1
         object Label10: TLabel
         object Label10: TLabel
           Left = 10
           Left = 10
           Height = 66
           Height = 66
           Top = 10
           Top = 10
-          Width = 841
+          Width = 837
           Align = alClient
           Align = alClient
           AutoSize = False
           AutoSize = False
           Caption = 'Here you can see Operations transmited/received from other nodes that will be included in next block. There is no guarantee that other nodes will include them when mining, so it''s important that you mine too to help include Operations to the main BlockChain'
           Caption = 'Here you can see Operations transmited/received from other nodes that will be included in next block. There is no guarantee that other nodes will include them when mining, so it''s important that you mine too to help include Operations to the main BlockChain'
@@ -859,8 +860,8 @@ object FRMWallet: TFRMWallet
     end
     end
     object tsBlockChain: TTabSheet
     object tsBlockChain: TTabSheet
       Caption = 'BlockChain Explorer'
       Caption = 'BlockChain Explorer'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       ImageIndex = 1
       ImageIndex = 1
       object Panel2: TPanel
       object Panel2: TPanel
         Left = 0
         Left = 0
@@ -868,6 +869,7 @@ object FRMWallet: TFRMWallet
         Top = 0
         Top = 0
         Width = 857
         Width = 857
         Align = alTop
         Align = alTop
+        BevelOuter = bvNone
         ClientHeight = 41
         ClientHeight = 41
         ClientWidth = 857
         ClientWidth = 857
         TabOrder = 0
         TabOrder = 0
@@ -913,29 +915,30 @@ object FRMWallet: TFRMWallet
     end
     end
     object tsOperations: TTabSheet
     object tsOperations: TTabSheet
       Caption = 'Operations Explorer'
       Caption = 'Operations Explorer'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       ImageIndex = 1
       ImageIndex = 1
       object Panel1: TPanel
       object Panel1: TPanel
         Left = 0
         Left = 0
         Height = 41
         Height = 41
         Top = 0
         Top = 0
-        Width = 861
+        Width = 857
         Align = alTop
         Align = alTop
+        BevelOuter = bvNone
         ClientHeight = 41
         ClientHeight = 41
-        ClientWidth = 861
+        ClientWidth = 857
         TabOrder = 0
         TabOrder = 0
         object Label2: TLabel
         object Label2: TLabel
           Left = 11
           Left = 11
           Height = 13
           Height = 13
           Top = 10
           Top = 10
-          Width = 121
+          Width = 102
           Caption = 'Filter by blocks range'
           Caption = 'Filter by blocks range'
           ParentColor = False
           ParentColor = False
         end
         end
         object ebFilterOperationsStartBlock: TEdit
         object ebFilterOperationsStartBlock: TEdit
           Left = 125
           Left = 125
-          Height = 23
+          Height = 21
           Top = 7
           Top = 7
           Width = 57
           Width = 57
           OnExit = ebFilterOperationsAccountExit
           OnExit = ebFilterOperationsAccountExit
@@ -944,7 +947,7 @@ object FRMWallet: TFRMWallet
         end
         end
         object ebFilterOperationsEndBlock: TEdit
         object ebFilterOperationsEndBlock: TEdit
           Left = 185
           Left = 185
-          Height = 23
+          Height = 21
           Top = 7
           Top = 7
           Width = 57
           Width = 57
           OnExit = ebFilterOperationsAccountExit
           OnExit = ebFilterOperationsAccountExit
@@ -954,9 +957,9 @@ object FRMWallet: TFRMWallet
       end
       end
       object dgOperationsExplorer: TDrawGrid
       object dgOperationsExplorer: TDrawGrid
         Left = 0
         Left = 0
-        Height = 420
+        Height = 399
         Top = 41
         Top = 41
-        Width = 861
+        Width = 857
         Align = alClient
         Align = alClient
         ExtendedSelect = False
         ExtendedSelect = False
         TabOrder = 1
         TabOrder = 1
@@ -967,32 +970,33 @@ object FRMWallet: TFRMWallet
     end
     end
     object tsLogs: TTabSheet
     object tsLogs: TTabSheet
       Caption = 'Logs'
       Caption = 'Logs'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       ImageIndex = 2
       ImageIndex = 2
       object pnlTopLogs: TPanel
       object pnlTopLogs: TPanel
         Left = 0
         Left = 0
         Height = 41
         Height = 41
         Top = 0
         Top = 0
-        Width = 861
+        Width = 857
         Align = alTop
         Align = alTop
+        BevelOuter = bvNone
         ClientHeight = 41
         ClientHeight = 41
-        ClientWidth = 861
+        ClientWidth = 857
         TabOrder = 0
         TabOrder = 0
         object cbShowDebugLogs: TCheckBox
         object cbShowDebugLogs: TCheckBox
           Left = 15
           Left = 15
-          Height = 24
+          Height = 19
           Top = 10
           Top = 10
-          Width = 145
+          Width = 102
           Caption = 'Show Debug logs'
           Caption = 'Show Debug logs'
           TabOrder = 0
           TabOrder = 0
         end
         end
       end
       end
       object memoLogs: TMemo
       object memoLogs: TMemo
         Left = 0
         Left = 0
-        Height = 420
+        Height = 399
         Top = 41
         Top = 41
-        Width = 861
+        Width = 857
         Align = alClient
         Align = alClient
         ScrollBars = ssBoth
         ScrollBars = ssBoth
         TabOrder = 1
         TabOrder = 1
@@ -1001,22 +1005,22 @@ object FRMWallet: TFRMWallet
     end
     end
     object tsNodeStats: TTabSheet
     object tsNodeStats: TTabSheet
       Caption = 'Node Stats'
       Caption = 'Node Stats'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       ImageIndex = 3
       ImageIndex = 3
       object Label3: TLabel
       object Label3: TLabel
         Left = 15
         Left = 15
         Height = 13
         Height = 13
         Top = 15
         Top = 15
-        Width = 207
+        Width = 177
         Caption = 'Active Net Connections of this Node:'
         Caption = 'Active Net Connections of this Node:'
         ParentColor = False
         ParentColor = False
       end
       end
       object Label6: TLabel
       object Label6: TLabel
         Left = 15
         Left = 15
         Height = 13
         Height = 13
-        Top = 312
-        Width = 202
+        Top = 291
+        Width = 198
         Anchors = [akLeft, akRight, akBottom]
         Anchors = [akLeft, akRight, akBottom]
         Caption = 'Available or possible Node Servers:'
         Caption = 'Available or possible Node Servers:'
         ParentColor = False
         ParentColor = False
@@ -1024,17 +1028,17 @@ object FRMWallet: TFRMWallet
       object Label7: TLabel
       object Label7: TLabel
         Left = 15
         Left = 15
         Height = 13
         Height = 13
-        Top = 208
-        Width = 103
+        Top = 187
+        Width = 99
         Anchors = [akLeft, akRight, akBottom]
         Anchors = [akLeft, akRight, akBottom]
         Caption = 'BlackList of Nodes'
         Caption = 'BlackList of Nodes'
         ParentColor = False
         ParentColor = False
       end
       end
       object memoNetConnections: TMemo
       object memoNetConnections: TMemo
         Left = 15
         Left = 15
-        Height = 166
+        Height = 145
         Top = 34
         Top = 34
-        Width = 834
+        Width = 830
         Anchors = [akTop, akLeft, akRight, akBottom]
         Anchors = [akTop, akLeft, akRight, akBottom]
         ReadOnly = True
         ReadOnly = True
         ScrollBars = ssBoth
         ScrollBars = ssBoth
@@ -1044,8 +1048,8 @@ object FRMWallet: TFRMWallet
       object memoNetServers: TMemo
       object memoNetServers: TMemo
         Left = 15
         Left = 15
         Height = 116
         Height = 116
-        Top = 331
-        Width = 834
+        Top = 310
+        Width = 830
         Anchors = [akLeft, akRight, akBottom]
         Anchors = [akLeft, akRight, akBottom]
         ReadOnly = True
         ReadOnly = True
         ScrollBars = ssBoth
         ScrollBars = ssBoth
@@ -1055,8 +1059,8 @@ object FRMWallet: TFRMWallet
       object memoNetBlackLists: TMemo
       object memoNetBlackLists: TMemo
         Left = 16
         Left = 16
         Height = 79
         Height = 79
-        Top = 227
-        Width = 833
+        Top = 206
+        Width = 829
         Anchors = [akLeft, akRight, akBottom]
         Anchors = [akLeft, akRight, akBottom]
         ReadOnly = True
         ReadOnly = True
         ScrollBars = ssBoth
         ScrollBars = ssBoth
@@ -1066,14 +1070,14 @@ object FRMWallet: TFRMWallet
     end
     end
     object tsMessages: TTabSheet
     object tsMessages: TTabSheet
       Caption = 'Messages'
       Caption = 'Messages'
-      ClientHeight = 461
-      ClientWidth = 861
+      ClientHeight = 440
+      ClientWidth = 857
       ImageIndex = 6
       ImageIndex = 6
       object Label11: TLabel
       object Label11: TLabel
         Left = 15
         Left = 15
         Height = 13
         Height = 13
         Top = 151
         Top = 151
-        Width = 59
+        Width = 51
         Caption = 'Messages:'
         Caption = 'Messages:'
         ParentColor = False
         ParentColor = False
       end
       end
@@ -1081,7 +1085,7 @@ object FRMWallet: TFRMWallet
         Left = 315
         Left = 315
         Height = 13
         Height = 13
         Top = 11
         Top = 11
-        Width = 99
+        Width = 85
         Caption = 'Message to send:'
         Caption = 'Message to send:'
         ParentColor = False
         ParentColor = False
       end
       end
@@ -1089,7 +1093,7 @@ object FRMWallet: TFRMWallet
         Left = 15
         Left = 15
         Height = 13
         Height = 13
         Top = 11
         Top = 11
-        Width = 126
+        Width = 107
         Caption = 'Available connections:'
         Caption = 'Available connections:'
         ParentColor = False
         ParentColor = False
       end
       end
@@ -1097,7 +1101,7 @@ object FRMWallet: TFRMWallet
         Left = 410
         Left = 410
         Height = 13
         Height = 13
         Top = 11
         Top = 11
-        Width = 430
+        Width = 361
         Caption = '(Messages will be encrypted, so only dest connection will be able to read it)'
         Caption = '(Messages will be encrypted, so only dest connection will be able to read it)'
         Font.Color = clGrayText
         Font.Color = clGrayText
         Font.Height = -11
         Font.Height = -11
@@ -1114,7 +1118,6 @@ object FRMWallet: TFRMWallet
         MultiSelect = True
         MultiSelect = True
         ScrollWidth = 273
         ScrollWidth = 273
         TabOrder = 0
         TabOrder = 0
-        TopIndex = -1
       end
       end
       object bbSendAMessage: TButton
       object bbSendAMessage: TButton
         Left = 315
         Left = 315
@@ -1127,9 +1130,9 @@ object FRMWallet: TFRMWallet
       end
       end
       object memoMessages: TMemo
       object memoMessages: TMemo
         Left = 15
         Left = 15
-        Height = 270
+        Height = 249
         Top = 170
         Top = 170
-        Width = 825
+        Width = 821
         Anchors = [akTop, akLeft, akRight, akBottom]
         Anchors = [akTop, akLeft, akRight, akBottom]
         Font.Color = clWindowText
         Font.Color = clWindowText
         Font.Height = -16
         Font.Height = -16

+ 0 - 2
Units/PascalCoin/UBlockChain.pas

@@ -2199,12 +2199,10 @@ begin
     CT_Op_Changekey : Begin
     CT_Op_Changekey : Begin
       OperationResume.newKey := TOpChangeKey(Operation).Data.new_accountkey;
       OperationResume.newKey := TOpChangeKey(Operation).Data.new_accountkey;
       OperationResume.OperationTxt := 'Change Key to '+TAccountComp.GetECInfoTxt( TOpChangeKey(Operation).Data.new_accountkey.EC_OpenSSL_NID );
       OperationResume.OperationTxt := 'Change Key to '+TAccountComp.GetECInfoTxt( TOpChangeKey(Operation).Data.new_accountkey.EC_OpenSSL_NID );
-      OperationResume.Fee := TOpChangeKey(Operation).Data.fee;
       Result := true;
       Result := true;
     End;
     End;
     CT_Op_Recover : Begin
     CT_Op_Recover : Begin
       OperationResume.OperationTxt := 'Recover founds';
       OperationResume.OperationTxt := 'Recover founds';
-      OperationResume.Fee := TOpRecoverFounds(Operation).Data.fee;
       Result := true;
       Result := true;
     End;
     End;
   else Exit;
   else Exit;

+ 1 - 1
Units/PascalCoin/UConst.pas

@@ -100,7 +100,7 @@ Const
   CT_Op_Changekey = $02;
   CT_Op_Changekey = $02;
   CT_Op_Recover = $03;
   CT_Op_Recover = $03;
 
 
-  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'1.5.4'{$ELSE}{$IFDEF TESTNET}'TESTNET 1.5.4'{$ELSE}{$ENDIF}{$ENDIF};
+  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'1.5.5'{$ELSE}{$IFDEF TESTNET}'TESTNET 1.5.5'{$ELSE}{$ENDIF}{$ENDIF};
 
 
   CT_Discover_IPs =  'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin2.ddns.net;pascalcoin1.dynamic-dns.net;pascalcoin1.dns1.us';
   CT_Discover_IPs =  'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin2.ddns.net;pascalcoin1.dynamic-dns.net;pascalcoin1.dns1.us';
 
 

+ 2 - 1
Units/PascalCoin/UCrypto.pas

@@ -52,7 +52,7 @@ Type
   public
   public
     Constructor Create;
     Constructor Create;
     Procedure GenerateRandomPrivateKey(EC_OpenSSL_NID : Word);
     Procedure GenerateRandomPrivateKey(EC_OpenSSL_NID : Word);
-    Destructor Destroy;
+    Destructor Destroy; override;
     Property PrivateKey : PEC_KEY read FPrivateKey;
     Property PrivateKey : PEC_KEY read FPrivateKey;
     Property PublicKey : TECDSA_Public read GetPublicKey;
     Property PublicKey : TECDSA_Public read GetPublicKey;
     Property PublicKeyPoint : PEC_POINT read GetPublicKeyPoint;
     Property PublicKeyPoint : PEC_POINT read GetPublicKeyPoint;
@@ -149,6 +149,7 @@ end;
 destructor TECPrivateKey.Destroy;
 destructor TECPrivateKey.Destroy;
 begin
 begin
   if Assigned(FPrivateKey) then EC_KEY_free(FPrivateKey);
   if Assigned(FPrivateKey) then EC_KEY_free(FPrivateKey);
+  inherited;
 end;
 end;
 
 
 function TECPrivateKey.ExportToRaw: TRawBytes;
 function TECPrivateKey.ExportToRaw: TRawBytes;

+ 7 - 1
Units/PascalCoin/UNetProtocol.pas

@@ -3369,6 +3369,8 @@ end;
 
 
 procedure TNetworkAdjustedTime.UpdateMedian(list : TList);
 procedure TNetworkAdjustedTime.UpdateMedian(list : TList);
 Var last : Integer;
 Var last : Integer;
+  i : Integer;
+  s : String;
 begin
 begin
   last := FTimeOffset;
   last := FTimeOffset;
   list.Sort(SortPNetworkAdjustedTimeReg);
   list.Sort(SortPNetworkAdjustedTimeReg);
@@ -3380,8 +3382,12 @@ begin
     FTimeOffset := PNetworkAdjustedTimeReg(list[list.Count DIV 2])^.timeOffset;
     FTimeOffset := PNetworkAdjustedTimeReg(list[list.Count DIV 2])^.timeOffset;
   end;
   end;
   if (last<>FTimeOffset) then begin
   if (last<>FTimeOffset) then begin
+    s := '';
+    for i := 0 to list.Count - 1 do begin
+      s := s + ',' + IntToStr(PNetworkAdjustedTimeReg(list[i])^.timeOffset);
+    end;
     TLog.NewLog(ltinfo,ClassName,
     TLog.NewLog(ltinfo,ClassName,
-      Format('Updated NAT median offset. My offset is now %d (before %d) based on %d/%d connections',[FTimeOffset,last,list.Count,FTotalCounter]));
+      Format('Updated NAT median offset. My offset is now %d (before %d) based on %d/%d connections %s',[FTimeOffset,last,list.Count,FTotalCounter,s]));
   end;
   end;
 end;
 end;
 
 

+ 57 - 44
Units/PascalCoin/UNode.pas

@@ -74,7 +74,7 @@ Type
     //
     //
     Procedure NotifyBlocksChanged;
     Procedure NotifyBlocksChanged;
     //
     //
-    procedure GetStoredOperationsFromAccount(const OperationsResume: TOperationsResumeList; account_number: Cardinal; MaxDepth, MaxOperations : Integer);
+    procedure GetStoredOperationsFromAccount(const OperationsResume: TOperationsResumeList; account_number: Cardinal; MaxDepth, StartOperation, EndOperation : Integer);
     Function FindOperation(Const OperationComp : TPCOperationsComp; Const OperationHash : TRawBytes; var block : Cardinal; var operation_block_index : Integer) : Boolean;
     Function FindOperation(Const OperationComp : TPCOperationsComp; Const OperationHash : TRawBytes; var block : Cardinal; var operation_block_index : Integer) : Boolean;
     //
     //
     Procedure AutoDiscoverNodes(Const ips : AnsiString);
     Procedure AutoDiscoverNodes(Const ips : AnsiString);
@@ -594,61 +594,73 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TNode.GetStoredOperationsFromAccount(const OperationsResume: TOperationsResumeList; account_number: Cardinal; MaxDepth, MaxOperations: Integer);
-  Procedure DoGetFromBlock(block_number : Cardinal; last_balance : Int64; act_depth : Integer);
+procedure TNode.GetStoredOperationsFromAccount(const OperationsResume: TOperationsResumeList; account_number: Cardinal; MaxDepth, StartOperation, EndOperation: Integer);
+  // Optimization:
+  // For better performance, will only include at "OperationsResume" values betweeen "startOperation" and "endOperation"
+  Procedure DoGetFromBlock(block_number : Integer; last_balance : Int64; act_depth : Integer; nOpsCounter : Integer);
   var opc : TPCOperationsComp;
   var opc : TPCOperationsComp;
     op : TPCOperation;
     op : TPCOperation;
     OPR : TOperationResume;
     OPR : TOperationResume;
     l : TList;
     l : TList;
     i : Integer;
     i : Integer;
-    next_block_number : Cardinal;
+    last_block_number, next_block_number : Integer;
   begin
   begin
-    if (act_depth<=0) Or ((block_number<=0) And (block_number>0)) then exit;
-
+    if (act_depth<=0) then exit;
     opc := TPCOperationsComp.Create(Nil);
     opc := TPCOperationsComp.Create(Nil);
     Try
     Try
-      If not Bank.Storage.LoadBlockChainBlock(opc,block_number) then begin
-        TLog.NewLog(lterror,ClassName,'Error searching for block '+inttostr(block_number));
-        exit;
-      end;
       l := TList.Create;
       l := TList.Create;
       try
       try
-        next_block_number := 0;
-        opc.OperationsHashTree.GetOperationsAffectingAccount(account_number,l);
-        for i := l.Count - 1 downto 0 do begin
-          op := opc.Operation[PtrInt(l.Items[i])];
-          if (i=0) then begin
-            If op.SenderAccount=account_number then next_block_number := op.Previous_Sender_updated_block
-            else next_block_number := op.Previous_Destination_updated_block;
+        last_block_number := block_number+1;
+        while (last_block_number>block_number) And (act_depth>0)
+          And (block_number >= (account_number DIV CT_AccountsPerBlock))
+          And (nOpsCounter <= EndOperation) do begin
+          last_block_number := block_number;
+          next_block_number := 0;
+          l.Clear;
+          If not Bank.Storage.LoadBlockChainBlock(opc,block_number) then begin
+            TLog.NewLog(lterror,ClassName,'Error searching for block '+inttostr(block_number));
+            exit;
           end;
           end;
-          If TPCOperation.OperationToOperationResume(block_number,Op,account_number,OPR) then begin
-            OPR.NOpInsideBlock := Op.tag; // Note: Used Op.tag to include operation index inside a list
-            OPR.time := opc.OperationBlock.timestamp;
+          opc.OperationsHashTree.GetOperationsAffectingAccount(account_number,l);
+          for i := l.Count - 1 downto 0 do begin
+            op := opc.Operation[PtrInt(l.Items[i])];
+            if (i=0) then begin
+              If op.SenderAccount=account_number then next_block_number := op.Previous_Sender_updated_block
+              else next_block_number := op.Previous_Destination_updated_block;
+            end;
+            If TPCOperation.OperationToOperationResume(block_number,Op,account_number,OPR) then begin
+              OPR.NOpInsideBlock := Op.tag; // Note: Used Op.tag to include operation index inside a list
+              OPR.time := opc.OperationBlock.timestamp;
+              OPR.Block := block_number;
+              OPR.Balance := last_balance;
+              last_balance := last_balance - ( OPR.Amount + OPR.Fee );
+              if (nOpsCounter>=StartOperation) And (nOpsCounter<=EndOperation) then begin
+                OperationsResume.Add(OPR);
+              end;
+              inc(nOpsCounter);
+            end;
+          end;
+          // Is a new block operation?
+          if (TAccountComp.AccountBlock(account_number)=block_number) And ((account_number MOD CT_AccountsPerBlock)=0) then begin
+            OPR := CT_TOperationResume_NUL;
+            OPR.valid := true;
             OPR.Block := block_number;
             OPR.Block := block_number;
+            OPR.time := opc.OperationBlock.timestamp;
+            OPR.AffectedAccount := account_number;
+            OPR.Amount := opc.OperationBlock.reward;
+            OPR.Fee := opc.OperationBlock.fee;
             OPR.Balance := last_balance;
             OPR.Balance := last_balance;
-            last_balance := last_balance - ( OPR.Amount + OPR.Fee );
-            OperationsResume.Add(OPR);
+            OPR.OperationTxt := 'Blockchain reward';
+            if (nOpsCounter>=StartOperation) And (nOpsCounter<=EndOperation) then begin
+              OperationsResume.Add(OPR);
+            end;
+            inc(nOpsCounter);
           end;
           end;
+          //
+          opc.Clear(true);
+          dec(act_depth);
+          block_number := next_block_number;
         end;
         end;
-        // Is a new block operation?
-        if (TAccountComp.AccountBlock(account_number)=block_number) And ((account_number MOD CT_AccountsPerBlock)=0) then begin
-          OPR := CT_TOperationResume_NUL;
-          OPR.valid := true;
-          OPR.Block := block_number;
-          OPR.time := opc.OperationBlock.timestamp;
-          OPR.AffectedAccount := account_number;
-          OPR.Amount := opc.OperationBlock.reward;
-          OPR.Fee := opc.OperationBlock.fee;
-          OPR.Balance := last_balance;
-          OPR.OperationTxt := 'Blockchain reward';
-          OperationsResume.Add(OPR);
-        end;
-        //
-        opc.Clear(true);
-        if (next_block_number>=0) And (next_block_number<block_number) And (act_depth>0)
-           And (next_block_number >= (account_number DIV CT_AccountsPerBlock))
-           And ((OperationsResume.Count<MaxOperations) Or (MaxOperations<=0))
-           then DoGetFromBlock(next_block_number,last_balance,act_depth-1);
       finally
       finally
         l.Free;
         l.Free;
       end;
       end;
@@ -659,10 +671,11 @@ procedure TNode.GetStoredOperationsFromAccount(const OperationsResume: TOperatio
 
 
 Var acc : TAccount;
 Var acc : TAccount;
 begin
 begin
-  if MaxDepth<0 then exit;
-  if account_number>=Bank.SafeBox.AccountsCount then exit;
+  if MaxDepth<0 then Exit;
+  if account_number>=Bank.SafeBox.AccountsCount then Exit;
+  if StartOperation>EndOperation then Exit;
   acc := Bank.SafeBox.Account(account_number);
   acc := Bank.SafeBox.Account(account_number);
-  if (acc.updated_block>0) Or (acc.account=0) then DoGetFromBlock(acc.updated_block,acc.balance,MaxDepth);
+  if (acc.updated_block>0) Or (acc.account=0) then DoGetFromBlock(acc.updated_block,acc.balance,MaxDepth,0);
 end;
 end;
 
 
 function TNode.FindOperation(const OperationComp: TPCOperationsComp;
 function TNode.FindOperation(const OperationComp: TPCOperationsComp;

+ 39 - 27
Units/PascalCoin/URPC.pas

@@ -19,7 +19,7 @@ unit URPC;
 
 
 interface
 interface
 
 
-Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain,
+Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain, Math,
   UNetProtocol, UOpTransaction, UWalletKeys, UTime, UAES, UECIES,
   UNetProtocol, UOpTransaction, UWalletKeys, UTime, UAES, UECIES,
   UJSONFunctions, classes, blcksock, synsock, IniFiles, Variants;
   UJSONFunctions, classes, blcksock, synsock, IniFiles, Variants;
 
 
@@ -409,7 +409,7 @@ function TRPCProcess.ProcessMethod(const method: String; params: TPCJSONObject;
 
 
   Function ToJSONCurrency(pascalCoins : Int64) : Real;
   Function ToJSONCurrency(pascalCoins : Int64) : Real;
   Begin
   Begin
-    Result := pascalCoins / 10000;
+    Result := RoundTo( pascalCoins / 10000 , -4);
   End;
   End;
 
 
   Function ToPascalCoins(jsonCurr : Real) : Int64;
   Function ToPascalCoins(jsonCurr : Real) : Int64;
@@ -538,48 +538,60 @@ function TRPCProcess.ProcessMethod(const method: String; params: TPCJSONObject;
     jsonObject.GetAsVariant('rawoperations').Value:=OperationsHashTreeToHexaString(OperationsHashTree);
     jsonObject.GetAsVariant('rawoperations').Value:=OperationsHashTreeToHexaString(OperationsHashTree);
   End;
   End;
 
 
-  Function GetAccountOperations(AccountNumber : Cardinal; jsonArray : TPCJSONArray; MaxBlocksDepht,start,max : Integer) : Boolean;
+  Function GetAccountOperations(accountNumber : Cardinal; jsonArray : TPCJSONArray; maxBlocksDepth, startReg, maxReg: Integer) : Boolean;
   var list : TList;
   var list : TList;
     Op : TPCOperation;
     Op : TPCOperation;
     OPR : TOperationResume;
     OPR : TOperationResume;
     Obj : TPCJSONObject;
     Obj : TPCJSONObject;
     OperationsResume : TOperationsResumeList;
     OperationsResume : TOperationsResumeList;
-    i : Integer;
+    i, nCounter : Integer;
   Begin
   Begin
+    Result := false;
+    if (startReg<-1) or (maxReg<=0) then begin
+      ErrorNum := CT_RPC_ErrNum_InvalidData;
+      ErrorDesc := 'Invalid start or max value';
+      Exit;
+    end;
+    nCounter := 0;
     OperationsResume := TOperationsResumeList.Create;
     OperationsResume := TOperationsResumeList.Create;
     try
     try
-      list := TList.Create;
-      Try
-        FNode.Operations.OperationsHashTree.GetOperationsAffectingAccount(AccountNumber,list);
-        for i := list.Count - 1 downto 0 do begin
-          Op := FNode.Operations.OperationsHashTree.GetOperation(PtrInt(list[i]));
-          If TPCOperation.OperationToOperationResume(0,Op,AccountNumber,OPR) then begin
-            OPR.NOpInsideBlock := i;
-            OPR.Block := FNode.Operations.OperationBlock.block;
-            OPR.Balance := FNode.Operations.SafeBoxTransaction.Account(AccountNumber).balance;
-            OperationsResume.Add(OPR);
+      if (startReg=-1) then begin
+        // 1.5.5 change: If start=-1 then will include PENDING OPERATIONS, otherwise not.
+        // Only will return pending operations if start=0, otherwise
+        list := TList.Create;
+        Try
+          FNode.Operations.OperationsHashTree.GetOperationsAffectingAccount(accountNumber,list);
+          for i := list.Count - 1 downto 0 do begin
+            Op := FNode.Operations.OperationsHashTree.GetOperation(PtrInt(list[i]));
+            If TPCOperation.OperationToOperationResume(0,Op,accountNumber,OPR) then begin
+              OPR.NOpInsideBlock := i;
+              OPR.Block := FNode.Operations.OperationBlock.block;
+              OPR.Balance := FNode.Operations.SafeBoxTransaction.Account(accountNumber).balance;
+              if (nCounter>=startReg) And (nCounter<maxReg) then begin
+                OperationsResume.Add(OPR);
+              end;
+              inc(nCounter);
+            end;
           end;
           end;
-        end;
-      Finally
-        list.Free;
-      End;
-      if ((max<=0) Or (OperationsResume.Count<(max+start))) then begin
-        FNode.GetStoredOperationsFromAccount(OperationsResume,AccountNumber,MaxBlocksDepht,max+start);
+        Finally
+          list.Free;
+        End;
+      end;
+      if (nCounter<maxReg) then begin
+        if (startReg<0) then startReg := 0; // Prevent -1 value
+        FNode.GetStoredOperationsFromAccount(OperationsResume,accountNumber,maxBlocksDepth,startReg,startReg+maxReg-1);
       end;
       end;
-      //
       for i:=0 to OperationsResume.Count-1 do begin
       for i:=0 to OperationsResume.Count-1 do begin
-        if (i>=start) then begin
-          Obj := jsonArray.GetAsObject(jsonArray.Count);
-          OPR := OperationsResume[i];
-          FillOperationResumeToJSONObject(OPR,Obj);
-          if ((max>0) And (jsonArray.Count>=max)) then break; // stop
-        end;
+        Obj := jsonArray.GetAsObject(jsonArray.Count);
+        OPR := OperationsResume[i];
+        FillOperationResumeToJSONObject(OPR,Obj);
       end;
       end;
       Result := True;
       Result := True;
     finally
     finally
       OperationsResume.Free;
       OperationsResume.Free;
     end;
     end;
   end;
   end;
+
   Procedure GetConnections;
   Procedure GetConnections;
   var i : Integer;
   var i : Integer;
     l : TList;
     l : TList;

+ 1 - 1
Units/Utils/UGridUtils.pas

@@ -874,7 +874,7 @@ begin
         Finally
         Finally
           list.Free;
           list.Free;
         End;
         End;
-        Node.GetStoredOperationsFromAccount(FOperationsResume,AccountNumber,100,5000);
+        Node.GetStoredOperationsFromAccount(FOperationsResume,AccountNumber,100,0,5000);
       end;
       end;
     end;
     end;
   Finally
   Finally