Remove height as a term

Unbeknowst to me, height doesn't have a universal definition of the 
chain length.

Bitcoin defines height as the block number, with getblockcount existing 
for the chain length.

Ethereum uses the unambiguous term "block number".

Monero defines height as both the block number and the chain length.

Instead of arguing about who's right, it's agreed it referring to both 
isn't productive. While we could provide our own definition, taking a 
side, moving to the unambiguous block number prevents future hiccups.

height is now only a term in the Monero code, where it takes its 
Monero-specific definition, as documented in the processor.
This commit is contained in:
Luke Parker
2022-10-15 21:39:06 -04:00
parent a245ee28c1
commit 514563cef0
5 changed files with 82 additions and 84 deletions

View File

@@ -206,7 +206,7 @@ impl Rpc {
self.get_transactions(&[tx]).await.map(|mut txs| txs.swap_remove(0))
}
pub async fn get_transaction_height(&self, tx: &[u8]) -> Result<usize, RpcError> {
pub async fn get_transaction_block_number(&self, tx: &[u8]) -> Result<usize, RpcError> {
let txs: TransactionsResponse =
self.rpc_call("get_transactions", Some(json!({ "txs_hashes": [hex::encode(tx)] }))).await?;