You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
People are experiencing the bot giving incorrect balances after the pending deposits update.
After looking at trade data I have identified that the function responsible for the problem is this one:
starts on line 268 in exchange.php
protected function postRefreshWallets( $tradesMade ) {
$id = $this->getID();
foreach ( $this->wallets as $coin => $balance ) {
if ( !isset( $this->walletsBackup[ $coin ] ) ) {
$this->walletsBackup[ $coin ] = 0;
}
if ( $balance != $this->walletsBackup[ $coin ] ) {
// Assume that a change in the balance when we aren't trading may be an incoming
// deposit being credited, look for one!
$change = $balance - $this->walletsBackup[ $coin ];
if ( isset( $tradesMade[ $id ][ $coin ] ) ) {
// If we have made a trade at this exchange of this coin, make sure to discount
// the change if it's less than the trade amount.
if ( abs( $change ) < abs( $tradesMade[ $id ][ $coin ] ) ) {
$change = 0;
} else {
$change += -$tradesMade[ $id ][ $coin ];
}
}
$pendingDeposit = Database::getPendingDeposit( $coin, $id );
if ( $pendingDeposit > 0 && $change != 0 ) {
Database::savePendingDeposit( $coin, -$change, $id );
}
}
}
Database::saveWallets( $id, $this->wallets );
However I'm unsure how to deal with fixing it
The text was updated successfully, but these errors were encountered:
People are experiencing the bot giving incorrect balances after the pending deposits update.
After looking at trade data I have identified that the function responsible for the problem is this one:
starts on line 268 in exchange.php
protected function postRefreshWallets( $tradesMade ) {
$id = $this->getID();
foreach ( $this->wallets as $coin => $balance ) {
if ( !isset( $this->walletsBackup[ $coin ] ) ) {
$this->walletsBackup[ $coin ] = 0;
}
if ( $balance != $this->walletsBackup[ $coin ] ) {
// Assume that a change in the balance when we aren't trading may be an incoming
// deposit being credited, look for one!
$change = $balance - $this->walletsBackup[ $coin ];
if ( isset( $tradesMade[ $id ][ $coin ] ) ) {
// If we have made a trade at this exchange of this coin, make sure to discount
// the change if it's less than the trade amount.
if ( abs( $change ) < abs( $tradesMade[ $id ][ $coin ] ) ) {
$change = 0;
} else {
$change += -$tradesMade[ $id ][ $coin ];
}
}
$pendingDeposit = Database::getPendingDeposit( $coin, $id );
if ( $pendingDeposit > 0 && $change != 0 ) {
Database::savePendingDeposit( $coin, -$change, $id );
}
}
}
Database::saveWallets( $id, $this->wallets );
However I'm unsure how to deal with fixing it
The text was updated successfully, but these errors were encountered: