A solution would be to keep a record of "last-checked time" and then re-scan any old blk files that have a modified time greater or equal to the last-checked time. This check could be run any time a new block notification is received.
Once it writes to a blk file, it never checks files lower than that anymore. That is a RAM variable though, so it gets set back to zero each time a node is restarted.
Why would it need to check for previous files appends on new blocks? If the issue only happens on fresh node start (when free space in older block files is eligible), as long as Armory sees that one new block, it will work.
Armory does not expect blocks to appear in order in files. It will check block data on disk from the last known block to have extended the chain. Therefor if you have up to blk01000.dat and the last top is in blk00997.dat, it will check #977 to #1000 on every new block notifications until it finds a block that extends the chain again.
Would re-scanning already scanned blk files cause problems for Armory?
DB is designed to whistand being written over. Rescanning is fine. As a matter of fact, on each start Armory rewinds back 100 blocks from the last known top to account for long reorgs occuring while it wasn't running. You can see it here:
https://github.com/goatpig/BitcoinArmory/blob/master/cppForSwig/DatabaseBuilder.cpp#L55 //rewind the top block offset to catch on missed blocks for db init
auto topBlock = blockchain_->top();
auto rewindHeight = topBlock->getBlockHeight();
if (rewindHeight > 100)
rewindHeight -= 100;
else
rewindHeight = 1;
auto rewindBlock = blockchain_->getHeaderByHeight(rewindHeight);
topBlockOffset_.fileID_ = rewindBlock->getBlockFileNum();
topBlockOffset_.offset_ = rewindBlock->getOffset();
LOGINFO << "Rewinding 100 blocks";
You can increase this value to try and confirm your theory. On Bitcoin a blk file is ~100 blocks, on BCH idk, try much larger stuff.
The ultimate solution would be blocks over P2P, but idk what kind of mess BCH will be by the time I'm done with that. Chances are Armory won't be compatible anymore at that point.