New settings for viewing special address pages

-Add new address_page.enable_hidden_address_view setting which controls whether the special hidden_address address page can be viewed
-Add new address_page.enable_unknown_address_view setting which controls whether the special unknown_address address page can be viewed
-route to special coinbase address is permanently disabled
This commit is contained in:
joeuhren
2021-03-22 18:45:47 -06:00
parent 1392280575
commit a7d1ae8d0c
5 changed files with 113 additions and 74 deletions
+11 -6
View File
@@ -178,12 +178,17 @@ function route_get_index(res, error) {
}
function route_get_address(res, hash) {
db.get_address(hash, false, function(address) {
if (address)
res.render('address', { active: 'address', address: address, showSync: db.check_show_sync_message()});
else
route_get_index(res, hash + ' not found');
});
// check if trying to load a special address
if (hash != null && hash.toLowerCase() != 'coinbase' && ((hash.toLowerCase() == 'hidden_address' && settings.address_page.enable_hidden_address_view == true) || (hash.toLowerCase() == 'unknown_address' && settings.address_page.enable_unknown_address_view == true) || (hash.toLowerCase() != 'hidden_address' && hash.toLowerCase() != 'unknown_address'))) {
// lookup address in local collection
db.get_address(hash, false, function(address) {
if (address)
res.render('address', { active: 'address', address: address, showSync: db.check_show_sync_message()});
else
route_get_index(res, hash + ' not found');
});
} else
route_get_index(res, hash + ' not found');
}
function route_get_claim_form(res, hash) {