Skip to content

Commit b7151e0

Browse files
committed
Upgrade after review
1 parent 77faa41 commit b7151e0

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ function sendRawTransaction($rawtx,$gethRPC){
422422
$amount = hexdec(substr($tr_info,-64));
423423

424424
// get the infos
425-
$status = getAccountStatus($from_add, $to_add, $contract)
425+
$status = getAccountStatus(array($from_add, $to_add), $contract)
426426
$from_status = $status[$from_add];
427427
$to_status = $status[$to_add];
428428

@@ -489,7 +489,7 @@ function sendRawTransaction($rawtx,$gethRPC){
489489
// get the amount
490490
$amount = hexdec(substr($tr_info,-64));
491491

492-
$status = getAccountStatus($sender, $dest, $contract)
492+
$status = getAccountStatus(array($sender, $dest), $contract)
493493
$from_status = $status[$sender];
494494
$to_status = $status[$dest];
495495

checkAdmin.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,19 @@ function checkSign($dat, $signature, $caller){
226226
}
227227

228228

229-
function getAccountStatus($add_1, $add_2, $contract) {
229+
function getAccountStatus($addresses, $contract) {
230230
$version = getVersion($contract);
231231
$result= array($add_1=0,$add_2=0);
232232
if (strlen($version)>0) {
233233
// New Contract use isActive
234-
$result[$add_1] = isActive($add_1, $contract);
235-
$result[$add_2] = isActive($add_2, $contract);
234+
foreach ( $addresses as $add) {
235+
$result[$add] = isActive($add, $contract);
236+
}
236237
} else {
237-
// Old contract fold back on getAccStatus
238-
$result[$add_1] = getAccStatus($add_1, $contract);
239-
$result[$add_2] = getAccStatus($add_2, $contract);
238+
// Old contract fallback on getAccStatus
239+
foreach ( $addresses as $add) {
240+
$result[$add] = getAccStatus($add, $contract);
241+
}
240242
}
241243

242244
return $result;
@@ -254,7 +256,8 @@ function checkLegitimateAdmin($dat, $signature, $caller, $server){
254256

255257
// Get the caller type and status
256258
$acctype = getAccType($caller, $contract);
257-
$accStatus = getAccStatus($caller, $contract);
259+
$status =getAccountStatus(array($caller), $contract);
260+
$accStatus = $status[$caller];
258261

259262
if ($acctype==2 && $accStatus==1){
260263
$result = true;

0 commit comments

Comments
 (0)