Re: [bitcoin-dev] BIP 68 Questions

2015-07-02 Thread Rusty Russell
Rusty Russell  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.
___
bitcoin-dev mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev


[bitcoin-dev] BIP 68 Questions

2015-07-01 Thread Rusty Russell
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.
___
bitcoin-dev mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev