|
@@ -177,7 +177,7 @@ type
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
- UECIES, UConst, UOpTransaction, UAES, UFRMWalletKeys, UUserInterface, UPCDataTypes;
|
|
|
+ UECIES, UCoreUtils, UConst, UOpTransaction, UAES, UFRMWalletKeys, UUserInterface, UPCDataTypes;
|
|
|
|
|
|
{$R *.lfm}
|
|
|
|
|
@@ -221,7 +221,7 @@ begin
|
|
|
for iAcc := 0 to Length(_senderAccounts) - 1 do begin
|
|
|
loop_start:
|
|
|
op := Nil;
|
|
|
- account := FNode.Operations.SafeBoxTransaction.Account(_senderAccounts[iAcc]);
|
|
|
+ account := FNode.GetAccount(_senderAccounts[iAcc]);
|
|
|
If Not UpdatePayload(account, errors) then
|
|
|
raise Exception.Create('Error encoding payload of sender account '+TAccountComp.AccountNumberToAccountTxtNumber(account.account)+': '+errors);
|
|
|
i := WalletKeys.IndexOfAccountKey(account.accountInfo.accountKey);
|
|
@@ -552,7 +552,7 @@ end;
|
|
|
|
|
|
function TFRMOperation.GetDefaultSenderAccount: TAccount;
|
|
|
begin
|
|
|
- if FSenderAccounts.Count>=1 then Result := FNode.Operations.SafeBoxTransaction.Account( FSenderAccounts.Get(0) )
|
|
|
+ if FSenderAccounts.Count>=1 then Result := FNode.GetAccount( FSenderAccounts.Get(0) )
|
|
|
else Result := CT_Account_NUL;
|
|
|
end;
|
|
|
|
|
@@ -607,8 +607,8 @@ begin
|
|
|
end;
|
|
|
If SenderAccounts.Count>=1 then begin
|
|
|
ebSignerAccount.text := TAccountComp.AccountNumberToAccountTxtNumber(SenderAccounts.Get(0));
|
|
|
- ebChangeName.Text := FNode.Operations.SafeBoxTransaction.Account(SenderAccounts.Get(0)).name.ToPrintable;
|
|
|
- ebChangeType.Text := IntToStr(FNode.Operations.SafeBoxTransaction.Account(SenderAccounts.Get(0)).account_type);
|
|
|
+ ebChangeName.Text := FNode.GetAccount(SenderAccounts.Get(0)).name.ToPrintable;
|
|
|
+ ebChangeType.Text := IntToStr(FNode.GetAccount(SenderAccounts.Get(0)).account_type);
|
|
|
end else begin
|
|
|
ebSignerAccount.text := '';
|
|
|
ebChangeName.Text := '';
|
|
@@ -699,7 +699,7 @@ begin
|
|
|
ebSenderAccount.Text := TAccountComp.AccountNumberToAccountTxtNumber(SenderAccounts.Get(0));
|
|
|
memoAccounts.Visible := false;
|
|
|
ebSenderAccount.Visible := true;
|
|
|
- balance := TNode.Node.Operations.SafeBoxTransaction.Account(SenderAccounts.Get(0)).balance;
|
|
|
+ balance := TNode.Node.GetAccount(SenderAccounts.Get(0)).balance;
|
|
|
end else begin
|
|
|
// Multiple sender accounts
|
|
|
lblAccountCaption.Caption := 'Accounts';
|
|
@@ -707,7 +707,7 @@ begin
|
|
|
ebSenderAccount.Visible := false;
|
|
|
accountstext := '';
|
|
|
for i := 0 to SenderAccounts.Count - 1 do begin
|
|
|
- acc := TNode.Node.Operations.SafeBoxTransaction.Account(SenderAccounts.Get(i));
|
|
|
+ acc := TNode.Node.GetAccount(SenderAccounts.Get(i));
|
|
|
balance := balance + acc.balance;
|
|
|
if (accountstext<>'') then accountstext:=accountstext+'; ';
|
|
|
accountstext := accountstext+TAccountComp.AccountNumberToAccountTxtNumber(acc.account)+' ('+TAccountComp.FormatMoney(acc.balance)+')';
|
|
@@ -760,7 +760,7 @@ begin
|
|
|
errors := 'Invalid account number';
|
|
|
exit;
|
|
|
end;
|
|
|
- AccountToBuy := FNode.Operations.SafeBoxTransaction.Account(c);
|
|
|
+ AccountToBuy := FNode.GetAccount(c);
|
|
|
If not TAccountComp.IsAccountForSale(AccountToBuy.accountInfo) then begin
|
|
|
errors := 'Account '+TAccountComp.AccountNumberToAccountTxtNumber(c)+' is not for sale';
|
|
|
exit;
|
|
@@ -822,7 +822,7 @@ begin
|
|
|
errors := 'Signer account does not exists '+TAccountComp.AccountNumberToAccountTxtNumber(auxC);
|
|
|
exit;
|
|
|
end;
|
|
|
- SignerAccount := FNode.Operations.SafeBoxTransaction.Account(auxC);
|
|
|
+ SignerAccount := FNode.GetAccount(auxC);
|
|
|
if (TAccountComp.IsAccountLocked(SignerAccount.accountInfo,FNode.Bank.BlocksCount)) then begin
|
|
|
errors := 'Signer account '+TAccountComp.AccountNumberToAccountTxtNumber(SignerAccount.account)+' is locked until block '+IntToStr(SignerAccount.accountInfo.locked_until_block);
|
|
|
exit;
|
|
@@ -917,7 +917,7 @@ begin
|
|
|
errors := 'Signer account does not exists '+TAccountComp.AccountNumberToAccountTxtNumber(auxC);
|
|
|
exit;
|
|
|
end;
|
|
|
- SignerAccount := FNode.Operations.SafeBoxTransaction.Account(auxC);
|
|
|
+ SignerAccount := FNode.GetAccount(auxC);
|
|
|
if (TAccountComp.IsAccountLocked(SignerAccount.accountInfo,FNode.Bank.BlocksCount)) then begin
|
|
|
errors := 'Signer account '+TAccountComp.AccountNumberToAccountTxtNumber(SignerAccount.account)+' is locked until block '+IntToStr(SignerAccount.accountInfo.locked_until_block);
|
|
|
exit;
|
|
@@ -963,7 +963,7 @@ begin
|
|
|
errors := 'Signer account does not exists '+TAccountComp.AccountNumberToAccountTxtNumber(auxC);
|
|
|
exit;
|
|
|
end;
|
|
|
- SignerAccount := FNode.Operations.SafeBoxTransaction.Account(auxC);
|
|
|
+ SignerAccount := FNode.GetAccount(auxC);
|
|
|
if (TAccountComp.IsAccountLocked(SignerAccount.accountInfo,FNode.Bank.BlocksCount)) then begin
|
|
|
errors := 'Signer account '+TAccountComp.AccountNumberToAccountTxtNumber(SignerAccount.account)+' is locked until block '+IntToStr(SignerAccount.accountInfo.locked_until_block);
|
|
|
exit;
|
|
@@ -1133,7 +1133,7 @@ begin
|
|
|
errors := 'Signer account does not exists '+TAccountComp.AccountNumberToAccountTxtNumber(auxC);
|
|
|
exit;
|
|
|
end;
|
|
|
- SignerAccount := FNode.Operations.SafeBoxTransaction.Account(auxC);
|
|
|
+ SignerAccount := FNode.GetAccount(auxC);
|
|
|
// Seller
|
|
|
If Not TAccountComp.AccountTxtNumberToAccountNumber(ebSellerAccount.Text,auxC) then begin
|
|
|
errors := 'Invalid seller account';
|
|
@@ -1148,7 +1148,7 @@ begin
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
- SellerAccount := FNode.Operations.SafeBoxTransaction.Account(auxC);
|
|
|
+ SellerAccount := FNode.GetAccount(auxC);
|
|
|
if rbListAccountForPrivateSale.Checked then begin
|
|
|
lblSaleNewOwnerPublicKey.Enabled := true;
|
|
|
ebSaleNewOwnerPublicKey.Enabled := true;
|
|
@@ -1209,7 +1209,7 @@ begin
|
|
|
lblTransactionErrors.Caption := errors;
|
|
|
exit;
|
|
|
end;
|
|
|
- DestAccount := TNode.Node.Operations.SafeBoxTransaction.Account(c);
|
|
|
+ DestAccount := TNode.Node.GetAccount(c);
|
|
|
if SenderAccounts.Count=1 then begin
|
|
|
if not TAccountComp.TxtToMoney(ebAmount.Text,amount) then begin
|
|
|
errors := 'Invalid amount ('+ebAmount.Text+')';
|
|
@@ -1256,7 +1256,7 @@ begin
|
|
|
if (rbEncryptedWithOldEC.Checked) then begin
|
|
|
// Use sender
|
|
|
errors := 'Error encrypting';
|
|
|
- account := FNode.Operations.SafeBoxTransaction.Account(SenderAccount.account);
|
|
|
+ account := FNode.GetAccount(SenderAccount.account);
|
|
|
payload_encrypted := ECIESEncrypt(account.accountInfo.accountKey,TEncoding.ANSI.GetBytes(payload_u));
|
|
|
valid := Length(payload_encrypted)>0;
|
|
|
end else if (rbEncryptedWithEC.Checked) then begin
|
|
@@ -1292,7 +1292,7 @@ begin
|
|
|
errors := 'Invalid payload encrypted account number: '+TAccountComp.AccountNumberToAccountTxtNumber(dest_account_number);
|
|
|
exit;
|
|
|
end;
|
|
|
- account := FNode.Operations.SafeBoxTransaction.Account(dest_account_number);
|
|
|
+ account := FNode.GetAccount(dest_account_number);
|
|
|
payload_encrypted := ECIESEncrypt(account.accountInfo.accountKey,TEncoding.ANSI.GetBytes(payload_u));
|
|
|
valid := Length(payload_encrypted)>0;
|
|
|
end else if (PageControlOpType.ActivePage=tsChangePrivateKey) then begin
|