From 37a04a00f03e1f77e3aed3839987205a2d5668cf Mon Sep 17 00:00:00 2001 From: Skybuck Flying Date: Wed, 22 Dec 2021 23:52:25 +0100 Subject: [PATCH] Some fixes for GUI/Wallet Experimental Not all compile/build problems fixed yet. --- .../UFRMPascalCoinWalletConfig.pas | 20 +++++++++---------- src/gui-experimental/UFRMPayloadDecoder.pas | 6 +++--- src/gui-experimental/UUserInterface.pas | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gui-experimental/UFRMPascalCoinWalletConfig.pas b/src/gui-experimental/UFRMPascalCoinWalletConfig.pas index ce28b7142..65e72037b 100644 --- a/src/gui-experimental/UFRMPascalCoinWalletConfig.pas +++ b/src/gui-experimental/UFRMPascalCoinWalletConfig.pas @@ -110,7 +110,7 @@ procedure TFRMPascalCoinWalletConfig.bbOkClick(Sender: TObject); i := PtrInt(cbPrivateKeyToMine.Items.Objects[cbPrivateKeyToMine.ItemIndex]); if (i<0) Or (i>=TWallet.Keys.Count) then raise Exception.Create('Invalid private key'); if NOT TWallet.Keys.Key[i].HasPrivateKey then raise Exception.Create('Cannot use key "' + TWallet.Keys.Key[i].Name + '" for mining since it is watch-only'); - TSettings.MinerSelectedPrivateKey := TAccountComp.AccountKey2RawString(TWallet.Keys.Key[i].AccountKey); + TSettings.MinerSelectedPublicKey := TAccountComp.AccountKey2RawString(TWallet.Keys.Key[i].AccountKey); end else mpk := mpk_Random; if cbDownloadNewCheckpoint.Checked then begin @@ -120,15 +120,15 @@ procedure TFRMPascalCoinWalletConfig.bbOkClick(Sender: TObject); end else TSettings.AllowDownloadNewCheckpointIfOlderThan := False; TSettings.MinerPrivateKeyType := mpk; - TSettings.MinerServerRpcActive := cbJSONRPCMinerServerActive.Checked; - TSettings.MinerServerRpcPort := udJSONRPCMinerServerPort.Position; + TSettings.JsonRpcMinerServerActive := cbJSONRPCMinerServerActive.Checked; + TSettings.JsonRpcMinerServerPort := udJSONRPCMinerServerPort.Position; TSettings.SaveLogFiles := cbSaveLogFiles.Checked; TSettings.ShowLogs := cbShowLogs.Checked; TSettings.SaveDebugLogs := cbSaveDebugLogs.Checked; TSettings.MinerName := ebMinerName.Text; TSettings.ShowModalMessages := cbShowModalMessages.Checked; - TSettings.RpcPortEnabled := cbJSONRPCPortEnabled.Checked; - TSettings.RpcAllowedIPs := ebJSONRPCAllowedIPs.Text; + TSettings.JsonRpcPortEnabled := cbJSONRPCPortEnabled.Checked; + TSettings.JsonRpcAllowedIPs := ebJSONRPCAllowedIPs.Text; TSettings.Save; ModalResult := MrOk; end; @@ -199,7 +199,7 @@ procedure TFRMPascalCoinWalletConfig.RefreshUI; Try udInternetServerPort.Position := TSettings.InternetServerPort; ebDefaultFee.Text := TAccountComp.FormatMoney(TSettings.DefaultFee); - cbJSONRPCMinerServerActive.Checked := TSettings.MinerServerRpcActive; + cbJSONRPCMinerServerActive.Checked := TSettings.JsonRpcMinerServerActive; case TSettings.MinerPrivateKeyType of mpk_NewEachTime : rbGenerateANewPrivateKeyEachBlock.Checked := true; mpk_Random : rbUseARandomKey.Checked := true; @@ -212,9 +212,9 @@ procedure TFRMPascalCoinWalletConfig.RefreshUI; cbSaveDebugLogs.Checked := TSettings.SaveDebugLogs; ebMinerName.Text := TSettings.MinerName; cbShowModalMessages.Checked := TSettings.ShowModalMessages; - udJSONRPCMinerServerPort.Position := TSettings.MinerServerRpcPort; - cbJSONRPCPortEnabled.Checked := TSettings.RpcPortEnabled; - ebJSONRPCAllowedIPs.Text := TSettings.RpcAllowedIPs; + udJSONRPCMinerServerPort.Position := TSettings.JsonRpcMinerServerPort; + cbJSONRPCPortEnabled.Checked := TSettings.JsonRpcPortEnabled; + ebJSONRPCAllowedIPs.Text := TSettings.JsonRpcAllowedIPs; cbDownloadNewCheckpoint.Checked := TSettings.AllowDownloadNewCheckpointIfOlderThan; ebMinFutureBlocksToDownloadNewSafebox.Text := IntToStr(TSettings.MinFutureBlocksToDownloadNewSafebox); Except @@ -249,7 +249,7 @@ procedure TFRMPascalCoinWalletConfig.RefreshUI_WalletAspect; end; end; cbPrivateKeyToMine.Sorted := true; - raw := TSettings.MinerSelectedPrivateKey; + raw := TSettings.MinerSelectedPublicKey; iselected := TWallet.Keys.IndexOfAccountKey(TAccountComp.RawString2Accountkey(raw)); if iselected >= 0 then begin iselected := cbPrivateKeyToMine.Items.IndexOfObject(TObject(iselected)); diff --git a/src/gui-experimental/UFRMPayloadDecoder.pas b/src/gui-experimental/UFRMPayloadDecoder.pas index 82edb04b2..2335d0794 100644 --- a/src/gui-experimental/UFRMPayloadDecoder.pas +++ b/src/gui-experimental/UFRMPayloadDecoder.pas @@ -150,9 +150,9 @@ procedure TFRMPayloadDecoder.DoFind(Const OpHash : String); raise Exception.Create('Invalid OPHASH'); end; Case TNode.Node.FindNOperation(nBlock,nAccount,nN_Operation,opr) of - invalid_params : raise Exception.Create(Format('Not a valid OpHash searching at Block:%d Account:%d N_Operation:%d',[nBlock,nAccount,nN_Operation])); - blockchain_block_not_found : raise Exception.Create('Your blockchain file does not contain all blocks to find'); - found : ; + OpHash_invalid_params : raise Exception.Create(Format('Not a valid OpHash searching at Block:%d Account:%d N_Operation:%d',[nBlock,nAccount,nN_Operation])); + OpHash_block_not_found : raise Exception.Create('Your blockchain file does not contain all blocks to find'); + OpHash_found : ; else raise Exception.Create('ERROR DEV 20171120-6'); end; If (TPCOperation.EqualOperationHashes(opr.OperationHash,r)) Or diff --git a/src/gui-experimental/UUserInterface.pas b/src/gui-experimental/UUserInterface.pas index 3bcf39058..d17e35ef6 100644 --- a/src/gui-experimental/UUserInterface.pas +++ b/src/gui-experimental/UUserInterface.pas @@ -372,8 +372,8 @@ class procedure TUserInterface.StartApplication(mainForm : TForm); // Start RPC server FRPCServer := TRPCServer.Create; FRPCServer.WalletKeys := TWallet.Keys; - FRPCServer.Active := TSettings.RpcPortEnabled; - FRPCServer.ValidIPs := TSettings.RpcAllowedIPs; + FRPCServer.Active := TSettings.JsonRpcPortEnabled; + FRPCServer.ValidIPs := TSettings.JsonRpcAllowedIPs; TWallet.Keys.SafeBox := FNode.Bank.SafeBox; // Initialise Database