Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
monero-project
CCS Backend
Commits
95260c71
Commit
95260c71
authored
Jan 28, 2019
by
xiphon
Browse files
fix mem pool deposits confirmations updating
parent
f37b758e
Pipeline
#85
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/WalletNotify.php
View file @
95260c71
...
...
@@ -51,7 +51,7 @@ class walletNotify extends Command
}
$min_height
=
Deposit
::
max
(
'block_received'
);
$transactions
=
$wallet
->
scanIncomingTransfers
(
max
(
$min_height
,
1
0
)
-
1
0
);
$transactions
=
$wallet
->
scanIncomingTransfers
(
max
(
$min_height
,
5
0
)
-
5
0
);
$transactions
->
each
(
function
(
$transaction
)
use
(
$wallet
)
{
$this
->
processPayment
(
$transaction
);
});
...
...
@@ -66,10 +66,15 @@ class walletNotify extends Command
*/
public
function
processPayment
(
Transaction
$transaction
)
{
// if the deposit exist, no need to try add it again
if
(
Deposit
::
where
(
'tx_id'
,
$transaction
->
id
)
->
exists
())
{
$deposit
=
Deposit
::
where
(
'tx_id'
,
$transaction
->
id
)
->
first
();
if
(
$deposit
)
{
if
(
$deposit
->
block_received
==
0
)
{
$deposit
->
block_received
=
$transaction
->
block_height
;
$deposit
->
save
();
}
return
null
;
}
$this
->
info
(
'amount: '
.
$transaction
->
amount
/
1000000000000
.
' confirmations:'
.
$transaction
->
confirmations
.
' tx_hash:'
.
$transaction
->
id
);
$this
->
info
(
'subaddr_index: '
.
$transaction
->
subaddr_index
);
...
...
@@ -96,7 +101,8 @@ class walletNotify extends Command
{
$count
=
0
;
//update all xmr deposit confirmations
Deposit
::
where
(
'confirmations'
,
'<'
,
10
)
Deposit
::
where
(
'confirmations'
,
'<'
,
50
)
->
where
(
'block_received'
,
'>'
,
0
)
->
each
(
function
(
$deposit
)
use
(
$blockheight
,
&
$count
)
{
$this
->
updateConfirmation
(
$blockheight
,
$deposit
);
$count
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment