From 4b9eabdf1694bd4ff168ea383951619f7888e25c Mon Sep 17 00:00:00 2001 From: Ola Date: Sat, 2 Nov 2024 09:23:56 +0100 Subject: [PATCH] Account for stake de-registration in account_info for vote delegation --- files/grest/rpc/account/account_info.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/grest/rpc/account/account_info.sql b/files/grest/rpc/account/account_info.sql index 1e4f19b7..0096be7d 100644 --- a/files/grest/rpc/account/account_info.sql +++ b/files/grest/rpc/account/account_info.sql @@ -87,6 +87,11 @@ BEGIN FROM delegation_vote AS dv1 WHERE dv1.addr_id = dv.addr_id AND dv1.id > dv.id) + AND NOT EXISTS ( + SELECT TRUE + FROM stake_deregistration + WHERE stake_deregistration.addr_id = dv.addr_id + AND stake_deregistration.tx_id > dv.tx_id) ) AS vote_t ON vote_t.addr_id = status_t.id LEFT JOIN ( SELECT