瀏覽代碼

Allow use Hardcoded RandomHash table on GUI

Note: This example will read a hardcoded RandomHash table based on UConst values if the files are available on the system (nothing if file not found)
PascalCoin 6 年之前
父節點
當前提交
2d16ae670d
共有 3 個文件被更改,包括 22 次插入0 次删除
  1. 3 0
      src/core/UConst.pas
  2. 12 0
      src/gui-classic/UFRMWallet.dfm
  3. 7 0
      src/gui-classic/UFRMWallet.pas

+ 3 - 0
src/core/UConst.pas

@@ -148,6 +148,9 @@ Const
 
   CT_Protocol_v3_PIP11_Percent = 20; // PIP-0011 20% Percent proposed and voted by PIP-0011
 
+  CT_Hardcoded_RandomHash_Table_Filename = 'HardcodedRH_75800.randomhash';
+  CT_Hardcoded_RandomHash_Table_HASH = '0A56291E8368AC855227B67A2F6CBEEFD2DB4CAE3CB8A473A7F6663C63368D0E';
+
   CT_PseudoOpSubtype_Miner                = 1;
   CT_PseudoOpSubtype_Developer            = 2;
 

+ 12 - 0
src/gui-classic/UFRMWallet.dfm

@@ -916,6 +916,10 @@ object FRMWallet: TFRMWallet
     object tsBlockChain: TTabSheet
       Caption = 'Block Explorer'
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel2: TPanel
         Left = 0
         Top = 0
@@ -1095,6 +1099,10 @@ object FRMWallet: TFRMWallet
     object tsNodeStats: TTabSheet
       Caption = 'Node Stats'
       ImageIndex = 3
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       DesignSize = (
         857
         438)
@@ -1164,6 +1172,10 @@ object FRMWallet: TFRMWallet
     object tsMessages: TTabSheet
       Caption = 'Messages'
       ImageIndex = 6
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       DesignSize = (
         857
         438)

+ 7 - 0
src/gui-classic/UFRMWallet.pas

@@ -375,9 +375,16 @@ end;
 
 procedure TThreadActivate.BCExecute;
 Var currentProcess : String;
+  LRaw : TRawBytes;
 begin
   FLastTC := 0;
   FLastMsg := '';
+  //
+  OnProgressNotify(Self,'Reading Hardcoded RandomHash file',0,0);
+  LRaw := TCrypto.HexaToRaw(CT_Hardcoded_RandomHash_Table_HASH);
+  TPascalCoinProtocol.AllowUseHardcodedRandomHashTable(
+    ExtractFileDir(Application.ExeName)+PathDelim+CT_Hardcoded_RandomHash_Table_Filename,
+    LRaw );
   // Read Operations saved from disk
   TNode.Node.InitSafeboxAndOperations($FFFFFFFF,OnProgressNotify); // New Build 2.1.4 to load pending operations buffer
   TNode.Node.AutoDiscoverNodes(CT_Discover_IPs);