Commit 62ec6d5f authored by TonyFord's avatar TonyFord
Browse files

get incoming tx

parent 5faadc7c
...@@ -150,13 +150,24 @@ $incoming_tx=array_map( ...@@ -150,13 +150,24 @@ $incoming_tx=array_map(
return $w['address'] == $_GET['addr'] ? 1 : 0; return $w['address'] == $_GET['addr'] ? 1 : 0;
}, $v['addr']['outputs'] ); }, $v['addr']['outputs'] );
}, $F->TX ); }, $F->TX );
$incoming_value=array_map(
function($v){
return array_map(
function($w){
return $w['address'] == $_GET['addr'] ? $w['value'] : 0;
}, $v['addr']['outputs'] );
}, $F->TX );
$incoming_tx=array_map( function($v) { return array_sum($v); } , $incoming_tx); $incoming_tx=array_map( function($v) { return array_sum($v); } , $incoming_tx);
$incoming_tx=array_sum($incoming_tx); $incoming_tx=array_sum($incoming_tx);
$incoming_value=array_map( function($v) { return array_sum($v); } , $incoming_value);
$incoming_value=array_sum($incoming_value);
$A=array( $A=array(
'incoming_tx' => $incoming_tx, 'incoming_tx' => $incoming_tx,
'balance' => $F->getaddressbalance()['confirmed'] //'balance' => $F->getaddressbalance()['confirmed']
'balance' => $incoming_value/100000000
); );
echo json_encode($A); echo json_encode($A);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment