Process SendResponse better

This commit is contained in:
Aditya Kulkarni
2019-09-17 13:32:27 -07:00
parent 0e8ab4d27d
commit 51658fe645

View File

@@ -714,7 +714,12 @@ impl LightClient {
client.send_transaction(Request::new(RawTransaction {data: tx_bytes.to_vec(), height: 0})) client.send_transaction(Request::new(RawTransaction {data: tx_bytes.to_vec(), height: 0}))
}) })
.and_then(move |response| { .and_then(move |response| {
infostrinner.replace(format!("{:?}", response.into_inner())); let sendresponse = response.into_inner();
if sendresponse.error_code == 0 {
infostrinner.replace(format!("Successfully broadcast Tx: {}", sendresponse.error_message));
} else {
infostrinner.replace(format!("Error: {:?}", sendresponse));
}
Ok(()) Ok(())
}) })
.map_err(|e| { .map_err(|e| {