public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] BIP 68 Questions
@ 2015-07-02  2:38 Rusty Russell
  2015-07-03  1:19 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2015-07-02  2:38 UTC (permalink / raw)
  To: Mark Friedenbach; +Cc: bitcoin-dev

Hi Mark,

        It looks like the code in BIP 68 compares the input's nSequence
against the transaction's nLockTime:

        if ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD)
            nMinHeight = std::max(nMinHeight, (int)tx.nLockTime);
        else
            nMinTime = std::max(nMinTime, (int64_t)tx.nLockTime);
    
        if (nMinHeight >= nBlockHeight)
            return nMinHeight;
        if (nMinTime >= nBlockTime)
            return nMinTime;
            
So if transaction B spends the output of transaction A:

1.  If A is in the blockchain already, you don't need a relative
    locktime since you know A's time.
2.  If it isn't, you can't create B since you don't know what
    value to set nLockTime to.

How was this supposed to work?

Thanks,
Rusty.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bitcoin-dev] BIP 68 Questions
  2015-07-02  2:38 [bitcoin-dev] BIP 68 Questions Rusty Russell
@ 2015-07-03  1:19 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2015-07-03  1:19 UTC (permalink / raw)
  To: Mark Friedenbach; +Cc: bitcoin-dev

Rusty Russell <rusty@rustcorp•com.au> writes:
> Hi Mark,
>
>         It looks like the code in BIP 68 compares the input's nSequence
> against the transaction's nLockTime:

No, forget this.  I misread the code.  Mark ELI5'd to me offlist, thanks!

FWIW, the code works :)

Cheers,
Rusty.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-03  1:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02  2:38 [bitcoin-dev] BIP 68 Questions Rusty Russell
2015-07-03  1:19 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox