Author

Topic: what is the point of using locktime apart from the obvious (Read 212 times)

staff
Activity: 3374
Merit: 6530
Just writing some code
It's done to discourage fee sniping. Bitcoin Core does this, and the comment in the source code describes why pretty well:
Quote
    // Discourage fee sniping.
    //
    // For a large miner the value of the transactions in the best block and
    // the mempool can exceed the cost of deliberately attempting to mine two
    // blocks to orphan the current best block. By setting nLockTime such that
    // only the next block can include the transaction, we discourage this
    // practice as the height restricted and limited blocksize gives miners
    // considering fee sniping fewer options for pulling off this attack.
    //
    // A simple way to think about this is from the wallet's point of view we
    // always want the blockchain to move forward. By setting nLockTime this
    // way we're basically making the statement that we only want this
    // transaction to appear in the next block; we don't want to potentially
    // encourage reorgs by allowing transactions to appear at lower heights
    // than the next block in forks of the best chain.
    //
    // Of course, the subsidy is high enough, and transaction volume low
    // enough, that fee sniping isn't a problem yet, but by implementing a fix
    // now we ensure code won't be written that makes assumptions about
    // nLockTime that preclude a fix later.
legendary
Activity: 1736
Merit: 1023
let me explain tht title a little better:

assume block 470000 was mined right now. i go to a service and make a withdrawal (this has actually happened with my BTC withdrawals from exchanges) the transaction that i receive has a locktime of 470000!

so my question is why include that in a transaction, it will be mined because it is over the time anyways with the next block 470001!

I've seem some services do this before as well and never really understood the purpose for manually including a nlocktime for the current block
hero member
Activity: 770
Merit: 500
Bazinga!
let me explain tht title a little better:

assume block 470000 was mined right now. i go to a service and make a withdrawal (this has actually happened with my BTC withdrawals from exchanges) the transaction that i receive has a locktime of 470000!

so my question is why include that in a transaction, it will be mined because it is over the time anyways with the next block 470001!
Jump to: