fn get_status(transactions: Vec<CachedTransaction>) -> HashExpand description
As per electrum documentation:
§To calculate the status of a script hash (or address):
-
order confirmed transactions to the script hash by increasing height (and position in the block if there are more than one in a block)
-
form a string that is the concatenation of strings “tx_hash:height:” for each transaction in order, where:
tx_hash is the transaction hash in hexadecimal height is the height of the block it is in.
-
Next, with mempool transactions in any order, append a similar string for those transactions, but where height is -1 if the transaction has at least one unconfirmed input, and 0 if all inputs are confirmed.
-
The status of the script hash is the sha256() hash of the full string expressed as a hexadecimal string, or null if the string is empty because there are no transactions.