M5StackSats icon indicating copy to clipboard operation
M5StackSats copied to clipboard

Room77: Check Inbound Capacity

Open rootzoll opened this issue 6 years ago • 3 comments

The POS sould check the remaining inbound capacity (biggest inbound on any channel open). At least when bar tender puts in amount that is higher than that limit it should let know that this amount is not possible at the moment and give options: make on-chain, open channel to node or manage inbound capacity.

rootzoll avatar Sep 06 '19 15:09 rootzoll

Added x2 functions. nodedetails, which returns the pubkey, channels, etc, and nodecheck, which takes the pubkey and checks capacity.

arcbtc avatar Sep 19 '19 09:09 arcbtc

Both run in setup, to use what nodecheck returns:

arcbtc avatar Sep 19 '19 09:09 arcbtc

JsonObject node = doc["node"]; long node_last_update = node["last_update"]; // 1567549590 const char* node_pub_key = node["pub_key"]; // "03d34c207eecb9045228c9f835d7a2ed950f2ba03a4f173ed6fd3a895cf00de201" const char* node_alias = node["alias"]; // "room77"

const char* node_addresses_0_network = node["addresses"][0]["network"]; // "tcp" const char* node_addresses_0_addr = node["addresses"][0]["addr"]; // "someip:9777"

const char* node_color = node["color"]; // "#68f442"

int num_channels = doc["num_channels"]; // 32 const char* total_capacity = doc["total_capacity"]; // "80037668"

arcbtc avatar Sep 19 '19 09:09 arcbtc