For each tx, check if matches staking/unbonding tx
Mark delegation as withdrawn and emit msg into rabbitmq
One thing to note is that there might be a race condition when bootstrapping BBN & BTC at the same time. You may consider only to bootstrap BTC txs a bit later.
Worth investigate if BBN emit its stored BTC head number as an event, and sync until this height.
Update:
We simply just need to register spend notification on staking and unbonding tx and then identify the spent path is withdrawal and mark status as "Withdrawn"
One thing to note is that there might be a race condition when bootstrapping BBN & BTC at the same time. You may consider only to bootstrap BTC txs a bit later. Worth investigate if BBN emit its stored BTC head number as an event, and sync until this height.
Update: We simply just need to register spend notification on staking and unbonding tx and then identify the spent path is withdrawal and mark status as "Withdrawn"