Bitcoin Forum
May 06, 2024, 03:31:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum Protocol: Transaction Confirmations  (Read 206 times)
ThisManIsTesting (OP)
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile
November 05, 2017, 02:34:11 AM
 #1

Looking for a method to get transaction confirmations,
Apparently there's nothing to do that in the protocol documentation

Docs: http://docs.electrum.org/en/latest/protocol.html
1715009512
Hero Member
*
Offline Offline

Posts: 1715009512

View Profile Personal Message (Offline)

Ignore
1715009512
Reply with quote  #2

1715009512
Report to moderator
1715009512
Hero Member
*
Offline Offline

Posts: 1715009512

View Profile Personal Message (Offline)

Ignore
1715009512
Reply with quote  #2

1715009512
Report to moderator
1715009512
Hero Member
*
Offline Offline

Posts: 1715009512

View Profile Personal Message (Offline)

Ignore
1715009512
Reply with quote  #2

1715009512
Report to moderator
Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
November 05, 2017, 05:30:46 AM
 #2

Does the "transaction.get" method give you the block# or height that it was confirmed in within the hex data? If so, then you could just calculate the difference between that number and the current blockchain height and that is your number of confirmations.

NOTE: I see the Address.get_history method returns block heights for the transactions associated with an address... maybe that's an option?

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
ThisManIsTesting (OP)
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile
November 05, 2017, 05:56:56 AM
 #3

Does the "transaction.get" method give you the block# or height that it was confirmed in within the hex data? If so, then you could just calculate the difference between that number and the current blockchain height and that is your number of confirmations.

NOTE: I see the Address.get_history method returns block heights for the transactions associated with an address... maybe that's an option?
Explain more please,
I do not know how confirmations are counted thanks for giving me an idea Smiley
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
November 05, 2017, 06:45:51 AM
 #4

"Confirmations" are simply the number of blocks that have been mined since the transaction was put into a block... the block it is put in, counts as 1 confirmation. The formula is:

Number of Confirmations = (current blockchain height - block height it was confirmed in) + 1

For example, your transaction is included in block# 492400... it now has 1 confirmation. 10 blocks later, at block# 492410, it will now have 11 confirmations... 10 blocks after that, at block# 492420, it will have 21 confirmations.

So... if you transaction was in block# 492400... and the current blockheight is 492502... # confirmations = (492502 - 492400) + 1 = 103 confirmations.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!