Make max payload for a transaction max block size.

The maximum payload for a transaction is limited to the size of a block
rather than the maximum payload for a given message.
This commit is contained in:
Dave Collins 2013-09-19 16:46:14 -05:00
parent 8679275090
commit e7f808378e
2 changed files with 2 additions and 2 deletions

View file

@ -300,7 +300,7 @@ func (msg *MsgTx) Command() string {
// MaxPayloadLength returns the maximum length the payload can be for the
// receiver. This is part of the Message interface implementation.
func (msg *MsgTx) MaxPayloadLength(pver uint32) uint32 {
return maxMessagePayload
return MaxBlockPayload
}
// NewMsgTx returns a new bitcoin tx message that conforms to the Message

View file

@ -34,7 +34,7 @@ func TestTx(t *testing.T) {
// Ensure max payload is expected value for latest protocol version.
// Num addresses (varInt) + max allowed addresses.
wantPayload := uint32(1024 * 1024 * 32)
wantPayload := uint32(1000 * 1000)
maxPayload := msg.MaxPayloadLength(pver)
if maxPayload != wantPayload {
t.Errorf("MaxPayloadLength: wrong max payload length for "+