mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 08:32:23 +03:00
Merge pull request #442 from kinode-dao/dr/fix-no-protocols-bug
fix: boot as direct if keyfile indicates desire to
This commit is contained in:
commit
390108a3e5
@ -707,7 +707,6 @@ pub async fn assign_routing(
|
||||
let namehash = FixedBytes::<32>::from_slice(&keygen::namehash(&our.name));
|
||||
let ip_call = ipCall { _0: namehash }.abi_encode();
|
||||
let key_call = keyCall { _0: namehash }.abi_encode();
|
||||
let router_call = routersCall { _0: namehash }.abi_encode();
|
||||
let tx_input = TransactionInput::new(Bytes::from(ip_call));
|
||||
let tx = TransactionRequest::default()
|
||||
.to(kns_address)
|
||||
@ -737,18 +736,6 @@ pub async fn assign_routing(
|
||||
));
|
||||
}
|
||||
|
||||
let router_tx_input = TransactionInput::new(Bytes::from(router_call));
|
||||
let router_tx = TransactionRequest::default()
|
||||
.to(kns_address)
|
||||
.input(router_tx_input);
|
||||
|
||||
let Ok(routers) = provider.call(&router_tx).await else {
|
||||
return Err(anyhow::anyhow!("Failed to fetch node routers from PKI"));
|
||||
};
|
||||
let Ok(routers) = <Vec<FixedBytes<32>>>::abi_decode(&routers, false) else {
|
||||
return Err(anyhow::anyhow!("Failed to decode node routers from PKI"));
|
||||
};
|
||||
|
||||
let node_ip = format!(
|
||||
"{}.{}.{}.{}",
|
||||
(ip >> 24) & 0xFF,
|
||||
@ -757,7 +744,7 @@ pub async fn assign_routing(
|
||||
ip & 0xFF
|
||||
);
|
||||
|
||||
if !routers.is_empty() {
|
||||
if !our.is_direct() {
|
||||
// indirect node
|
||||
return Ok(());
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ pub async fn terminal(
|
||||
_ = sigalrm.recv() => return Err(anyhow::anyhow!("exiting due to SIGALRM")),
|
||||
_ = sighup.recv() => return Err(anyhow::anyhow!("exiting due to SIGHUP")),
|
||||
_ = sigint.recv() => return Err(anyhow::anyhow!("exiting due to SIGINT")),
|
||||
_ = sigpipe.recv() => return Err(anyhow::anyhow!("exiting due to SIGPIPE")),
|
||||
_ = sigpipe.recv() => continue, // IGNORE SIGPIPE!
|
||||
_ = sigquit.recv() => return Err(anyhow::anyhow!("exiting due to SIGQUIT")),
|
||||
_ = sigterm.recv() => return Err(anyhow::anyhow!("exiting due to SIGTERM")),
|
||||
_ = sigusr1.recv() => return Err(anyhow::anyhow!("exiting due to SIGUSR1")),
|
||||
|
Loading…
Reference in New Issue
Block a user