Fixing bug with archived transactions
This will fix #563, only mark transactions as archived that have been confirmed.
This commit is contained in:
parent
b9ac698c51
commit
c55bf8354f
@ -35,8 +35,13 @@ class Transaction extends Base {
|
|||||||
* @param bool boolean True or False
|
* @param bool boolean True or False
|
||||||
**/
|
**/
|
||||||
public function setArchived($account_id, $txid) {
|
public function setArchived($account_id, $txid) {
|
||||||
$stmt = $this->mysqli->prepare("UPDATE $this->table SET archived = 1 WHERE account_id = ? AND id <= ?");
|
$stmt = $this->mysqli->prepare("
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $account_id, $txid) && $stmt->execute())
|
UPDATE $this->table AS t
|
||||||
|
INNER JOIN " . $this->block->getTableName() . " AS b
|
||||||
|
ON b.id = t.block_id
|
||||||
|
SET t.archived = 1
|
||||||
|
WHERE t.account_id = ? AND t.id <= ? AND b.confirmations >= ?");
|
||||||
|
if ($this->checkStmt($stmt) && $stmt->bind_param('iii', $account_id, $txid, $this->config['confirmations']) && $stmt->execute())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user