(quoted post by theymos)

4 messages BitcoinTalk theymos, ByteCoin, Satoshi Nakamoto November 15, 2010 — November 15, 2010
theymos November 15, 2010 Source · Permalink

That would be useful, but it’s probably best to keep scripts stateless. Since different nodes might have different ideas about what the current blockcount is, a situation could develop where half the network considers a transaction valid and half considers it invalid. This is not good for the network.

ByteCoin November 15, 2010 Source · Permalink

Quote from: theymos on November 15, 2010, 01:49:59 AM

That would be useful, but it’s probably best to keep scripts stateless. Since different nodes might have different ideas about what the current blockcount is, a situation could develop where half the network considers a transaction valid and half considers it invalid. This is not good for the network.

Hmm.. If clients disagree about what the current block count is then they already disagree about whether certain transactions are valid or not and therefore the problem you mention exists already without my proposal. Please go into more detail about why this is not good for the network.

ByteCoin

theymos November 15, 2010 Source · Permalink

After investigating some more, I found that nLockTime requires in-memory transaction replacement to be re-activated for it to be useful.

Code:if (mapNextTx.count(outpoint)) { // Disable replacement feature for now return false;

        // Allow replacing with a newer version of the same transaction
        if (i != 0)
            return false;
        ptxOld = mapNextTx[outpoint].ptx;
        if (!IsNewerThan(*ptxOld))
            return false;
        for (int i = 0; i < vin.size(); i++)
        {
            COutPoint outpoint = vin[i].prevout;
            if (!mapNextTx.count(outpoint) || mapNextTx[outpoint].ptx != ptxOld)
                return false;
        }
        break;
Satoshi Nakamoto November 15, 2010 Source · Permalink

We can’t safely do OP_BLOCKNUMBER.  In the event of a block chain reorg after a segmentation, transactions need to be able to get into the chain in a later block.  The OP_BLOCKNUMBER transaction and all its dependants would become invalid.  This wouldn’t be fair to later owners of the coins who weren’t involved in the time limited transaction.

nTimeLock does the reverse.  It’s an open transaction that can be replaced with new versions until the deadline.  It can’t be recorded until it locks.  The highest version when the deadline hits gets recorded.  It could be used, for example, to write an escrow transaction that will automatically permanently lock and go through unless it is revoked before the deadline.  The feature isn’t enabled or used yet, but the support is there so it could be implemented later.