Browse Source

Merge upstream

Herman Schoenfeld 6 năm trước cách đây
mục cha
commit
dd37c4dfd9
3 tập tin đã thay đổi với 57 bổ sung57 xóa
  1. 1 0
      README.md
  2. 6 2
      src/core/UOpTransaction.pas
  3. 50 55
      src/gui-classic/UFRMWallet.lfm

+ 1 - 0
README.md

@@ -37,6 +37,7 @@ Also, consider a donation at PascalCoin development account: "0-10"
 ### Current Build (Pending release date)
 - Upgrade to Protocol 5 (Hard fork)
 - Implementation of PIP-0030 -> https://github.com/PascalCoin/PascalCoin/blob/master/PIP/PIP-0030.md
+- New digest hash value for OP_DATA ( PIP-0016 ) on Protocol 5
 
 
 ### Build 4.0.3.1 - 2019-04-12

+ 6 - 2
src/core/UOpTransaction.pas

@@ -2462,7 +2462,7 @@ begin
 end;
 
 function TOpData.GetDigestToSign(current_protocol: Word): TRawBytes;
-var Stream : TStream;
+var Stream : TMemoryStream;
   b : Byte;
 begin
   Stream := TMemoryStream.Create;
@@ -2478,7 +2478,11 @@ begin
     TStreamOp.WriteAnsiString(Stream,FData.payload);
     b := OpType;
     Stream.Write(b,1);
-    Result := TStreamOp.SaveStreamToRaw(Stream);
+    if (current_protocol<=CT_PROTOCOL_4) then begin
+      Result := TStreamOp.SaveStreamToRaw(Stream);
+    end else begin
+      Result := TCrypto.DoSha256(Stream.Memory,Stream.Size);
+    end;
   finally
     Stream.Free;
   end;

+ 50 - 55
src/gui-classic/UFRMWallet.lfm

@@ -4,7 +4,7 @@ object FRMWallet: TFRMWallet
   Top = -403
   Width = 865
   Caption = 'Pascal Coin Wallet, JSON-RPC Miner & Explorer'
-  ClientHeight = 600
+  ClientHeight = 580
   ClientWidth = 865
   Color = clBtnFace
   Constraints.MinHeight = 600
@@ -15,8 +15,8 @@ object FRMWallet: TFRMWallet
   Menu = MainMenu
   OnCreate = FormCreate
   OnDestroy = FormDestroy
-  Position = poOwnerFormCenter
-  LCLVersion = '2.1.0.0'
+  Position = poScreenCenter
+  LCLVersion = '2.0.2.0'
   object pnlTop: TPanel
     Left = 0
     Height = 91
@@ -168,7 +168,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Height = 13
       Top = 11
-      Width = 61
+      Width = 60
       Caption = 'Total Blocks:'
       ParentColor = False
     end
@@ -184,7 +184,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Height = 13
       Top = 26
-      Width = 91
+      Width = 90
       Caption = 'Current Block Age:'
       ParentColor = False
     end
@@ -192,7 +192,7 @@ object FRMWallet: TFRMWallet
       Left = 198
       Height = 13
       Top = 26
-      Width = 82
+      Width = 81
       Caption = '000 seconds ago'
       ParentColor = False
     end
@@ -216,7 +216,7 @@ object FRMWallet: TFRMWallet
       Left = 90
       Height = 13
       Top = 56
-      Width = 66
+      Width = 65
       Caption = 'Miner Clients:'
       ParentColor = False
     end
@@ -232,7 +232,7 @@ object FRMWallet: TFRMWallet
       Left = 429
       Height = 13
       Top = 11
-      Width = 74
+      Width = 76
       Caption = 'Current Target:'
       ParentColor = False
     end
@@ -256,7 +256,7 @@ object FRMWallet: TFRMWallet
       Left = 285
       Height = 13
       Top = 26
-      Width = 70
+      Width = 69
       Caption = 'Time average:'
       ParentColor = False
     end
@@ -272,7 +272,7 @@ object FRMWallet: TFRMWallet
       Left = 168
       Height = 13
       Top = 70
-      Width = 16
+      Width = 15
       Caption = '???'
       ParentColor = False
     end
@@ -280,7 +280,7 @@ object FRMWallet: TFRMWallet
       Left = 285
       Height = 13
       Top = 11
-      Width = 47
+      Width = 48
       Caption = 'Accounts:'
       ParentColor = False
     end
@@ -308,7 +308,7 @@ object FRMWallet: TFRMWallet
       Left = 360
       Height = 13
       Top = 56
-      Width = 77
+      Width = 76
       Caption = 'Blocks Found:'
       Font.Color = clWindowText
       Font.Height = -11
@@ -364,8 +364,8 @@ object FRMWallet: TFRMWallet
   end
   object StatusBar: TStatusBar
     Left = 0
-    Height = 18
-    Top = 582
+    Height = 23
+    Top = 557
     Width = 865
     Panels = <    
       item
@@ -385,7 +385,7 @@ object FRMWallet: TFRMWallet
   end
   object PageControl: TPageControl
     Left = 0
-    Height = 491
+    Height = 466
     Top = 91
     Width = 865
     ActivePage = tsMyAccounts
@@ -395,11 +395,11 @@ object FRMWallet: TFRMWallet
     OnChange = PageControlChange
     object tsMyAccounts: TTabSheet
       Caption = 'Account Explorer'
-      ClientHeight = 461
-      ClientWidth = 859
+      ClientHeight = 440
+      ClientWidth = 857
       object Splitter1: TSplitter
         Left = 400
-        Height = 395
+        Height = 374
         Top = 66
         Width = 5
       end
@@ -407,43 +407,42 @@ object FRMWallet: TFRMWallet
         Left = 0
         Height = 66
         Top = 0
-        Width = 859
+        Width = 857
         Align = alTop
         BevelOuter = bvNone
         ClientHeight = 66
-        ClientWidth = 859
+        ClientWidth = 857
         TabOrder = 0
         object Label18: TLabel
           Left = 11
           Height = 13
           Top = 35
-          Width = 62
+          Width = 61
           Caption = 'Find account'
           ParentColor = False
         end
         object cbMyPrivateKeys: TComboBox
           Left = 260
-          Height = 20
+          Height = 21
           Top = 7
           Width = 411
-          ItemHeight = 26
+          ItemHeight = 13
           OnChange = cbMyPrivateKeysChange
           Style = csDropDownList
           TabOrder = 0
-          Text = '0'
         end
         object cbExploreMyAccounts: TCheckBox
           Left = 11
-          Height = 18
+          Height = 19
           Top = 10
-          Width = 240
+          Width = 235
           Caption = 'Explore accounts with one of my Wallet Keys'
           OnClick = cbExploreMyAccountsClick
           TabOrder = 1
         end
         object ebFindAccountNumber: TEdit
           Left = 87
-          Height = 22
+          Height = 21
           Top = 33
           Width = 83
           OnChange = ebFindAccountNumberChange
@@ -461,16 +460,16 @@ object FRMWallet: TFRMWallet
         end
         object cbFilterAccounts: TCheckBox
           Left = 260
-          Height = 18
+          Height = 19
           Top = 35
-          Width = 148
+          Width = 145
           Caption = 'Filter accounts by balance'
           OnClick = cbFilterAccountsClick
           TabOrder = 4
         end
         object ebFilterAccountByBalanceMin: TEdit
           Left = 412
-          Height = 22
+          Height = 21
           Hint = 'Min balance'
           Top = 33
           Width = 83
@@ -480,7 +479,7 @@ object FRMWallet: TFRMWallet
         end
         object ebFilterAccountByBalanceMax: TEdit
           Left = 503
-          Height = 22
+          Height = 21
           Hint = 'Max balance'
           Top = 33
           Width = 83
@@ -526,17 +525,17 @@ object FRMWallet: TFRMWallet
       end
       object pnlAccounts: TPanel
         Left = 0
-        Height = 395
+        Height = 374
         Top = 66
         Width = 400
         Align = alLeft
         BevelOuter = bvNone
-        ClientHeight = 395
+        ClientHeight = 374
         ClientWidth = 400
         TabOrder = 1
         object dgAccounts: TDrawGrid
           Left = 0
-          Height = 361
+          Height = 340
           Top = 0
           Width = 400
           Align = alClient
@@ -550,7 +549,7 @@ object FRMWallet: TFRMWallet
         object pnlAccountsInfo: TPanel
           Left = 0
           Height = 34
-          Top = 361
+          Top = 340
           Width = 400
           Align = alBottom
           BevelOuter = bvNone
@@ -561,7 +560,7 @@ object FRMWallet: TFRMWallet
             Left = 5
             Height = 13
             Top = 10
-            Width = 47
+            Width = 48
             Caption = 'Accounts:'
             ParentColor = False
           end
@@ -631,9 +630,9 @@ object FRMWallet: TFRMWallet
       end
       object pcAccountsOptions: TPageControl
         Left = 405
-        Height = 395
+        Height = 374
         Top = 66
-        Width = 454
+        Width = 452
         ActivePage = tsMultiSelectAccounts
         Align = alClient
         TabIndex = 1
@@ -658,12 +657,12 @@ object FRMWallet: TFRMWallet
         end
         object tsMultiSelectAccounts: TTabSheet
           Caption = 'Selected Accounts For Batch Operation'
-          ClientHeight = 365
-          ClientWidth = 448
+          ClientHeight = 348
+          ClientWidth = 444
           ImageIndex = 1
           object dgSelectedAccounts: TDrawGrid
             Left = 41
-            Height = 308
+            Height = 291
             Top = 31
             Width = 320
             Align = alLeft
@@ -677,11 +676,11 @@ object FRMWallet: TFRMWallet
             Left = 0
             Height = 31
             Top = 0
-            Width = 448
+            Width = 444
             Align = alTop
             BevelOuter = bvNone
             ClientHeight = 31
-            ClientWidth = 448
+            ClientWidth = 444
             Font.Color = clWindowText
             Font.Height = -13
             Font.Name = 'Tahoma'
@@ -692,7 +691,7 @@ object FRMWallet: TFRMWallet
               Left = 41
               Height = 16
               Top = 4
-              Width = 362
+              Width = 361
               Caption = 'Select multiple accounts to execute massive operations'
               ParentColor = False
             end
@@ -700,18 +699,18 @@ object FRMWallet: TFRMWallet
           object pnlSelectedAccountsBottom: TPanel
             Left = 0
             Height = 26
-            Top = 339
-            Width = 448
+            Top = 322
+            Width = 444
             Align = alBottom
             BevelOuter = bvNone
             ClientHeight = 26
-            ClientWidth = 448
+            ClientWidth = 444
             TabOrder = 2
             object Label20: TLabel
               Left = 41
               Height = 13
               Top = 6
-              Width = 47
+              Width = 48
               Caption = 'Accounts:'
               ParentColor = False
             end
@@ -742,12 +741,12 @@ object FRMWallet: TFRMWallet
           end
           object pnlSelectedAccountsLeft: TPanel
             Left = 0
-            Height = 308
+            Height = 291
             Top = 31
             Width = 41
             Align = alLeft
             BevelOuter = bvNone
-            ClientHeight = 308
+            ClientHeight = 291
             ClientWidth = 41
             TabOrder = 3
             object sbSelectedAccountsAdd: TSpeedButton
@@ -971,7 +970,7 @@ object FRMWallet: TFRMWallet
           Height = 21
           Top = 7
           Width = 56
-          ItemHeight = 26
+          ItemHeight = 13
           ItemIndex = 1
           Items.Strings = (
             'Kh/s'
@@ -1084,7 +1083,6 @@ object FRMWallet: TFRMWallet
         Top = 41
         Width = 857
         Align = alClient
-        Lines.Strings = (        )
         ScrollBars = ssBoth
         TabOrder = 1
         WordWrap = False
@@ -1127,7 +1125,6 @@ object FRMWallet: TFRMWallet
         Top = 34
         Width = 830
         Anchors = [akTop, akLeft, akRight, akBottom]
-        Lines.Strings = (        )
         ReadOnly = True
         ScrollBars = ssBoth
         TabOrder = 0
@@ -1139,7 +1136,6 @@ object FRMWallet: TFRMWallet
         Top = 310
         Width = 830
         Anchors = [akLeft, akRight, akBottom]
-        Lines.Strings = (        )
         ReadOnly = True
         ScrollBars = ssBoth
         TabOrder = 1
@@ -1151,7 +1147,6 @@ object FRMWallet: TFRMWallet
         Top = 206
         Width = 829
         Anchors = [akLeft, akRight, akBottom]
-        Lines.Strings = (        )
         ReadOnly = True
         ScrollBars = ssBoth
         TabOrder = 2